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


what is use of session tracking ?with example?



what is use of session tracking ?with example?..

Answer / sivasubramanian.k

Session Tracking is one of the most powerful features of
Servlets and JSP. Basically, the servlet engine takes care
of using Cookies in the right way to preserve state across
successive requests by the same user. Your servlet just
needs to call a single method (getSession) and it has
access to a persistent hashtable of data that's unique to
the current user

public void doPost(HttpServletRequest request,
HttpServletResponse response){
...
//lets take the session obj
HttpSession session = request.getSession(true);
//now let us take the user name assosiated with this session
String currUserLogin = (String) session.getAttribute
("currentUserLogin")
...
//now we do the work according to the user name
doSomeWork(currUserLogin);
...

}

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More Core Java Interview Questions

I want to control database connections in my program and want that only one thread should be able to make database connection at a time. How can I implement this logic?

0 Answers  


What is java in detail?

0 Answers  


What is memory leak and how does java handle it?

0 Answers  


What is the purpose of stub and skeleton?

0 Answers  


How java is similar to c?

0 Answers  


how to crate clint-server socket?

1 Answers   Accenture, Infosys, Infotech, TCS,


Explain about strings in java?

0 Answers  


What does java se mean?

0 Answers  


Is static variable stored in heap?

0 Answers  


How do you compare two strings? any predefined method for this?

3 Answers  


What is the mapping mechanism used by java to identify IDL language?

0 Answers  


What is Java Reflection API? Why it’s so important to have?

0 Answers  


Categories