Enterprise JavaBeans™ Component Architecture: Designing and Coding Enterprise Applications
by Gail Anderson, Paul Anderson
6.5. Session Facade Pattern
Consider what we need to do to integrate our Customer EJB into the Music Collection virtual shopping application (return to Figure 6-2 on page 205). When a user accesses the “login” web page, the JSP client asks for a login name and password. The client must determine if the user name is valid and if the password matches the given user name. We accomplish this multiple-step process by invoking method findByCustomerName(), which returns a collection. The client must then verify that only one Customer instance is in the collection. It then must call getPassword() and check to see if the entity bean's password matches the one provided by the user.
For a JSP client or stand-alone Java client to accomplish this task, we ...
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.
Read now
Unlock full access