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 how does JSP handle run-time exceptions?
What are the steps that are involved in using the httpservlet class?
A client sends requests to two different web components. Both of the components access the session. Will they end up using the same session object or different session ?
What are the ways to handle multi-threading in servlets?
Why servlet is mostly used?
Why is Servlet so popular?
Is servlet a framework?
What do you mean by url pattern in servlet?
What is the advantage of Servlets when compared with other server side technologies?
What do you mean by deployment descriptor?
What mechanisms are used by a Servlet Container to maintain session information?
What do you understand by mime type?
Difference between GET and POST?
What are the annotations used in servlet 3?
What is httpservlet and how it is different from genericservlet?