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 |
what is function overloading in java?
0 Answers Tavant Technologies, TCS, Virtusa,
Explain treeset?
what is meant wrapper classes?
why string constant pool in java
What are functions in java?
State the significance of public, private, protected class?
What is downcasting?
How Applets & Servlets will communicate with each other?
Can a constructor have different name than a class name in java?
What do you understand by a Static Variable?
What is meant by 'bit masking' in java?
What is the differenc between Enemuration interface and iterator interface according to accessing?