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 |
Can you override a final method?
What are the differences between wait() and sleep()?
When a thread is executing a synchronized method , then is it possible for the same thread to access other synchronized methods of an object ?
What is supplier in java?
What is a text string?
what methods would you overwrite in java.lang.object class?
what is bmg file and how to create that files?what will it contailn?
0 Answers HCL, Probe Services,
Is object a data type in java?
What is java in detail?
What is static and a non-static inner class?
What do you understand by garbage collection in Java? Can it be forced to run?
explain about casting of objects?