difference between request.getSession(false) or
request.getSession() and request.getSession(true)

Answer Posted / msreekanth2004

request.getSession(true) or request.getSession():
If session is present it returns that session. Otherwise
it'll create a new session and return that.

request.getSession(false):
If session is present it returns that session. Otherwise it
return "null"

Is This Answer Correct ?    45 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is war file?

576


What is the GenericServlet class?

595


When jsessionid is created?

599


Why do we have servlet listeners?

597


What does the term localization refer to?

578






When a client request is sent to the servlet container, how does the container choose which servlet to invoke?

569


What is the difference between Server and Container?

618


What is meant by Servlet? What are the parameters of service method?

592


What is the need of session tracking in web application?

579


Which httpsession object is used to view and manipulate information about a session?

725


What is a servlet engine?

542


What is difference between get and post method?

568


Explain jsessionid and when is it created?

591


How can we refresh automatically when new data has entered the database?

615


What is the use of send redirect () method?

584