File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes getSession(false); Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "getSession(false);" Watch "getSession(false);" New topic
Author

getSession(false);

Vipul Gulhane
Greenhorn

Joined: Mar 28, 2011
Posts: 20
What happen if I did Like this

HttpSession ses=resquest.getSession(false);
Santhosh ayiappan
Ranch Hand

Joined: Jan 30, 2007
Posts: 80

returns the session obj if the session is valid, else you will get null
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30795
    
157

What do you mean? You get a reference to the session if it exists. But that's in the JavaDoc so I'm guessing you are asking something more specific.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
bagaria kushal
Greenhorn

Joined: Mar 29, 2011
Posts: 19
This will check whether Session already existed for the request or not. If it existed then it will return the already existed Session. If Session is not already existed for this request then this method will return NULL, that means this method says that the request does not have a Session previously
 
 
subject: getSession(false);