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...

Q : In session created by server with client(browser) How
can server find that request coming is belong to new
session OR belong to session that is timeout.

Answer Posted / rajib

import javax.servelet.*;
public MyServelet extends HttpServelet{
public void doGet(HttpServeletRequest
req,HttpServeletResponse res)throws ServletException,IO
Exception{
res.setContentType("text/html");
PrintWriter out=res.getPrintWriter();
out.println("for trac session0");
HttpSession sess=req.getSession();
if(sess==null){
out.println(Old session not exist );
}else{
HttpSession session=request.getSession(true);
out.println("new Session Created.");
}}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is it that JComponent have add() and remove() methods but Component doesn’t?

955


Which tag should be used to pass information from jsp to include jsp?

912


What are the benefits of pagecontext implicit object?

1226


Mention the various implicit objects used in the expression

984


How do I use a scriptlet to initialize a newly instantiated bean?

949


How can information from one JSP be passed to another JSP?

1009


How can I prevent the output of my jsp or servlet pages from being cached by the browser?

1032


What is the difference between jsp and php?

904


How to deactivate el usage on jsp?

977


What is a jsp file?

890


What is the standard action?

920


How do you delete the session data?

990


How can I handle jsp page errors?

962


What is the major difference between servletcontext and pagecontext?

994


What are the main tags in jsp?

902