This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
I am a Computer Science student and have done some projects in java and also familiar with CGI/Perl. I am also learning JSPservlets. Now I am working in a project where I have to keep track of the logged person in a series of pages. As I knew CGI/perl session concept I am using the JSP sessions to do this. I am able to set sessions in one JSP page and retrive them in other. But in the CGI/perl scripts I used to set a session. The next page will get this session ID either from cookie or from query string and then gets the required variable from the session file. I wonder how the JSP file gets the session file to verify without the session ID. Please anyone help me to solve my this basic doubt.
Thanks Mukta
Jeroen Wenting
Ranch Hand
Joined: Oct 12, 2000
Posts: 5093
posted
0
The JSP will get the session for you automatically. Unlike in Perl you don't have to specifically get it from the request. The JSP is compiled into a Java servlet the first time it is run, and the code to get the session from the request is generated for you at that time so you can just access the session as if it always existed. That same code will also generate a new session for you if none exists, so that too you don't have to worry about.
42
Manish Tiwari
Greenhorn
Joined: May 19, 2004
Posts: 5
posted
0
Hi ,
It is because of implicit object "session" which is present automatically in jsp.
Mukta Rao
Greenhorn
Joined: May 25, 2004
Posts: 3
posted
0
I think now I understand JSP sessions better.. Thanks a lot