Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

setting the session true in the JSP  RSS feed

 
Kaustubh Patil
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI all...
Thankx 4 taking a look at my question
If i set the session=true in the JSP which is default...and then in the body of the jsp take the session from the request using
session = request.getSession(false);
will it imply that the false has no meaning becaust the session has already been made true..
does this mean that getSession(false) will never return a null but always a valid session.
Thanks,
Kaustubh.
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, because the JSP translator has already constructed a statement like
HttpSession session = request.getSession();
that executes before the start of your page.
- Peter
 
Kaustubh Patil
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thankx peter.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!