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 are different ways for authentication of servlet?
Which exception is thrown if the servlet is not initialized properly?
What is the use of servletconfig interface?
Name the different ways of session tracking.
Explain the concept of ssi ?
what do you understand by url rewriting?
What is http servlet? Explain with the help of an example.
Explain session tracking and its importance?
What are advantages of servlets over cgi?
Is servlet a server side scripting language?
What is session?
How does tomcat servlet container work?
What is a web application and what is it’s directory structure?
What is the difference between genericservlet and httpservlet
What is life cycle of Servlet?