Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

ejb client  RSS feed

 
mark I thomas
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • 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" ?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
 
Avinash Kandoti
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • 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
 
Jimmy Clark
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!