How we can check in particular page the session will be
alive or not
Answer Posted / ruchi
when we create session , we write
HttpSession session= res.getSessionn(true);
this checks whether there is a session bind on associated
request.if yes then it returns reference to session
object,otherwise create a session for associated request.
but if we want check that session is alive or not then we
write
HttpSession session= res.getSessionn(false);
this checks whether there is a session bind on associated
request.if yes then it returns reference to session
object,otherwise it returns null reference.
Is This Answer Correct ? | 9 Yes | 1 No |
Post New Answer View All Answers
Explain the methods of request dispatcher in servlet?
Explain the difference between a web server and a web container?
Can you refresh servlet in client and server-side automatically?
Why do we use sendredirect() method?
How to get the path of servlet in the server?
Explain servlet.
What is difference between the HTTP Servlet and Generic Servlet? Explain about their methods and parameters?
How can the session in servlet can be destroyed?
Explain mvc pattern.
What is the difference between jsp and servlet life cycle?
What is life cycle of Servlet?
What’s the use of the servlet wrapper classes??
Define the life cycle of a servlets.
How can we refresh automatically when new data is entered into the database?
What is difference between PrintWriter and ServletOutputStream?