Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Explain how does JSP handle run-time exceptions?

1162


What are the steps that are involved in using the httpservlet class?

1188


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 ?

1144


What are the ways to handle multi-threading in servlets?

1141


Why servlet is mostly used?

1289


Why is Servlet so popular?

1120


Is servlet a framework?

1096


What do you mean by url pattern in servlet?

1162


What is the advantage of Servlets when compared with other server side technologies?

2398


What do you mean by deployment descriptor?

1131


What mechanisms are used by a Servlet Container to maintain session information?

1218


What do you understand by mime type?

1037


Difference between GET and POST?

1221


What are the annotations used in servlet 3?

1084


What is httpservlet and how it is different from genericservlet?

1167