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

Answers were Sorted based on User's Feedback



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

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

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

Answer / bhaskar

Your answer 100% right

Is This Answer Correct ?    13 Yes 1 No

Post New Answer

More Servlets Interview Questions

What is the difference between the getrequestdispatcher(string path) method of javax.servlet.servletrequest interface and javax.servlet.servletcontext interface?

0 Answers  


What is the difference between sendredirect() and forward() in a servlet?

0 Answers  


What is the difference between genericservlet and httpservlet

0 Answers  


Differentiate between get and post?

0 Answers  


how this statement works..? public void service(HttpServletRequest request,HttpServletResponse response)

2 Answers   TCS,






How do cookies work in servlets?

0 Answers  


What are the differences between forward() method and sendredirect() methods?

0 Answers  


How ThreadSafe page attribute will be working in Servlet as well as in JSP?Automatically ThresdSafe is true in JSP so service method will be destroy in each and every request or not?so how thresd will handle srevice method?

1 Answers   AZTEC,


How do we translate jsp?

0 Answers  


Who is responsible for writing a constructor?

0 Answers  


What is servlet and how it works?

0 Answers  


what are the disadvantages of cookies?

8 Answers  


Categories