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

What is el in jsp?

980


What is custom tag library?

904


How do I open a jsp file?

1105


What are the elements of jsp?

1023


What is a page directive?

963


Can we use javascript with jsp pages?

1022


How do we print “
creates a new line in html” in jsp?

1154


Can a jsp page instantiate a serialized bean?

991


What are the implicit, internal el jsp objects and their differences from jsp objects?

1041


What is the purpose of ?

1030


Can a subsequent request be accessed with one’s servlet code, if a request attribute is already sent in his jsp?

1006


Give an example of using your own tags.

988


What are the different types of directives available in jsp?

921


Differentiate between pagecontext.include and jsp:include?

991


How can I maintain session in JSP Page in the bases of user name and password:

977