Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

all about session

 
sri charan
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello friends,

As we know that "Session" is specific to client.... in any project we may use JSP's, Servlet's and EJB's .... here we are using session at different level as scope in jsp , servlet and in ejb as a stateless or statefull.... i just want to know if a client sends a request of session scope is that application maintains only one session for the entire request or it differs form jsp to servlet to ejb( please take here as statefull session) ....

If it is not means is this against rules i mean ( session is specific to client )...... can any one please clear this.....
 
Pavan Sambare
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sessions are actually specific to your servers. JSPs/Servlets live on a web server and web servers have HttpSession objects in which you can store a user's session info.
EJBs live in an application server. The Session EJBs (either stateless or stateful) are totally different from the web server sessions. The stateful EJBs maintain their state across different requests from a client. It is not a session but a State of the EJB. i.e. values of it's instance variables.
 
sri charan
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello pavan,

thanks for reply.... but here i want to know how thesedifferent sessions communicate with each other... i mean how it knows that specific session related to specific client .... suppose for an appliation there was 10 client..... can you please tell me how a session identify's from all for the perticular client.... at different stages ( in jsp, servlet and in ejb) and these communicate....

thanks & regards
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are no sessions communicating. JSPs are just a different way to write servlets (they are actually compiled to servlets by the web container). The web container maintains one session per client. Clients are typically identified by cookies, or by adding an identifier to each URL (aka URL rewriting).

As Pavan explained, there are no sessions involved on the side of EJBs at all.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!