Skip to Content
Head First Servlets and JSP, 2nd Edition
book

Head First Servlets and JSP, 2nd Edition

by Bryan Basham, Kathy Sierra, Bert Bates
March 2008
Intermediate to advanced
911 pages
20h 31m
English
O'Reilly Media, Inc.
Content preview from Head First Servlets and JSP, 2nd Edition

Memorizing the EJB-related DD tags

This exam is about web components, not business components (although in the Patterns chapter, you’ll see a few things about business components). But if you’re deploying a J2EE app, complete with Enterprise JavaBeans (EJBs) in the business tier, some of your web components will probably need to lookup and access the enterprise beans. If you’re deploying an app in a full J2EE-compliant Container (one that has an EJB Container as well), you can define references to EJBs in the DD. You don’t have to know anything about EJBs for this exam, other than what you declare in the DD, so we won’t waste your time explaining it here.[11]

Reference to a local bean

image with no caption
image with no caption

A LOCAL bean means the client (in this case, a servlet) and the bean must be running in the same JVM.

Reference to a remote bean

<ejb-ref>
   <ejb-ref-name>ejb/LocalCustomer</ejb-ref-name>
   <ejb-ref-type>Entity</ejb-ref-type>
   <home>com.wickedlysmart.CustomerHome</home>
   <remote>com.wickedlysmart.Customer</remote>
</ejb-ref>
image with no caption

A REMOTE bean means the client (in this case, a servlet) and the bean can be running in different JVMs (possibly on different physical machines as well).

Note

(Optional sub-elements for both tags ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Head First Java, 2nd Edition

Head First Java, 2nd Edition

Kathy Sierra, Bert Bates
Head First Java, 3rd Edition

Head First Java, 3rd Edition

Kathy Sierra, Bert Bates, Trisha Gee
Learning Java, 6th Edition

Learning Java, 6th Edition

Marc Loy, Patrick Niemeyer, Daniel Leuck

Publisher Resources

ISBN: 9780596516680Errata PageSupplemental Content