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
What is difference between GenericServlet and HttpServlet?
How does tomcat servlet container work?
How to generate the server side programming and the advantages of it over the other languages?
Why is http protocol called as a stateless protocol?
Why do we have servlet listeners?
How is the get () method different from the post() method?
How can we include static files in the jsp page?
How can the session in servlet be destroyed?
What is difference between jsp and servlet?
What are the functions of the servlet container?
What are the difference between session and cookies in servlet? Explain
Why is Servlet so popular?
What is Servlets and explain the advantages of Servlet life cycle?
Explain the difference between a web server and a web container?
What is servlet and its use?