• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ejb client

 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am starting learning EJB. In a book I saw it creates a "EJB client" to test the session bean. IN the deployment part it also creates and deploys the client jar.

Suppose for a shopping cart application, sometimes an EJB is called by an action class or servlet. In this case, is that action class or servlet acting as the "client" ?
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes.
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes. Typically if you are using an EJB you would define a remote interface for the EJB your JSP action would invoke a servlet that calls the appropriate method on the remote interface. Ofcourse there are tons of other ways you can use an EJB like JSFs and stuff but if you are talking about action method this is the easiest way to use it
 
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Suppose for a shopping cart application, sometimes an EJB is called by an action class or servlet. In this case, is that action class or servlet acting as the "client" ?



The client object is the servlet object. Servlet objects use many different objects to execute. In some cases, servlet objects use action objects. They get information from the action object and may also execute behavior that is coded in an action object.

So, yes both the servlet object and the action object are client objects of a Session EJB.
 
reply
    Bookmark Topic Watch Topic
  • New Topic