Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Vijay Kumar
getSession() in servlet
1 Answer(s)      4 years and 2 months ago
Posted in : Servlet Interview Questions


What is the difference between using getSession(true) and getSession(false) methods?


Advertisement
View Answers

November 2, 2010 at 4:03 PM


getSession(true) will check whether a session already exists for the user. If yes, it will return that session object else it will create a new session object and return it.

getSession(false) will check existence of session. If session exists, then it returns the reference of that session object, if not, this methods will return null.



Related Tutorials/Questions & Answers:
 

 

 

DMCA.com