• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

doubt in the session="false" in page directive

 
raja ram
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have the below code in the JSP but request.getSession(false) is not returning null means session="false" is not working



what could be the reason.

Thanks
[ August 08, 2008: Message edited by: raja ram ]
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Raja ram,

session="false" means implicit session object(created by container) is not available..
but in your code,you are creating the session .

try this you will understand
----------------------------------------
session.setAttribute("key","value");
----------------------------------------

Hope This Helps
 
Anand Bhatt
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just run this program ,and for me I got the output as:

about to call getSession(false)null

org.apache.catalina.session.StandardSessionFacade@10df4e2

org.apache.catalina.session.StandardSessionFacade@10df4e2



For me its giving null,as you can see the output on first line.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For me its giving null

Try to update the page. You may not be part of a session the first time you access it.
 
Anand Bhatt
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes you are right Christophe , second time its returing some session value.
 
Anand Bhatt
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well is this due that second time the last two statments:

are overwriting the session="false" in page directive, as both two statements create a session at the end for the page.
correct me if I am wrong.
 
raja ram
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thanks for the replies.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic