• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Session object in a JSP

 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

If there is a jsp page that has a page directive disabling a session..

then how will the user's session be tracked....during the browsing of the application...

i.e. earlier pages and subsequent pages from this page..

Thanks in advance,
Regards
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The session directive doesn't really 'disable' sessions.
It just instructs the JSP compiler not to generate code that would explicitly create a session in this JSPs generated servlet.

If any JSP, or servlet has code that calls getSession(), then a session object will be created and the application will track sessions.
 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ben!!!
 
Chetan Chauhan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you do not wish to use in-built Session features then you can use
either of the following two techniques

1. Use Hidden Fields
2. Use Cookies

Then there will be no need to write code for session tracking.
But ofcourse some different code has to be there to implement this.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic