• Post Reply Bookmark Topic Watch Topic
  • New Topic

Difference between Session of SessionBean & servlet

 
Manish Jaju
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to know about the Session Used in Session Bean, How is it(session) used and handled in Session Bean. secondly what is the difference between the Session Used in Session Bean and Session used in Simple servlet. And how are they managed. Please elaborate with example, if possible.
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They are similar in some ways: both are dedicated to a single client, both last a long time until you tell them to go away or the server kills it for you, etc. However, a servlet session is only good for users of a website. What would you use if you wanted regular fat-clients to have the same sort of thing? (Answer: EJB Stateful Session Beans). Also, EJB SSBs also have full access to the EJB container's cool J2EE features like transactions, method security, etc. In addition, servlet sessions don't have methods and stuff that are meaningful to you -- they just store stuff for later use; EJB SSBs can have real methods that actually do neat stuff.

I'd recommend checking out the J2EE tutorial for more indepth fun reading.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!