difference between request.getSession(false) or
request.getSession() and request.getSession(true)
Answers were Sorted based on User's Feedback
Answer / 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 |
What do you mean by filter in servlet?
what are the CGI Programs?
What is the default http method in the servlet?
what is meant by servlet to servlet communication?
Can we override destroy method in servlet?
Can we get PrintWriter and ServletOutputStream both in a servlet?
Why is it that we can't give relative URL's when using ServletContext.getRequestDispatcher() when we can use the same while calling ServletRequest.getRequestDispatcher()?
what are the different services provided by the web server?
How to pass session values from one servlet container to another servlet container? or how can we get session values of one container in another container?
can i call destroy() method in init() method of servlet
Explain Action Servlet?
What is the effective way to make sure all the servlets are accessible only when user has a valid session?