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's the servlet interface?
Explain their methods? Tell me their parameter names also have you used threads in servlet?
Is servlet a controller?
Explain web application directory arrangement?
How do you find out what client machine is making a request to your servlet
Which are the different ways you can communicate between servlets?
When a client request is sent to the servlet container, how does the container choose which servlet to invoke?
What are some advantages of storing session state in cookies?
How do cookies work in servlets?
Hi frnd can i any one kindly can post for me portlet,hibernate and spring example application and with flow explantion configuration using Jdeveloper.and related links ar tutorials kindly please send me .its urgent for me .thanks in advance...........else can any one send to kondaiah.goddeti@gmail.com
How printwriter is different from servletoutputstream?
List out difference between a JavaBean from a Servlet?
Differentiate between the get and post method
What do you mean by annotations in servlet?
What is called Session Tracking?