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
Describe some assignments that are executed by servlet container?
What is the use of servlet wrapper classes?
What do you mean by web applications?
How are filters?
What is a deployment descriptor?
In the servlets, we are having a web page that is invoking servlets ,username and password? which is checks in database? Suppose the second page also if we want to verify
List out the difference between ServletConfig and ServletContext?
Which is better jsp or servlet?
What do you mean by interservlet communication?
What is difference between cookies and httpsession?
Explain session tracking and its importance?
What are the servlet events?
Explain the jar and war files in servlet?
Which event is fired at the time of setting, getting or removing attribute from application scope?
Can filter be used as request or response?