Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet

 
Raghavendra Holla
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have following doubts with regards to servlets.

1) When we say HttpSession mysession =request.getSession(true);
and they if I do mysession.putValue("Cat3", "0");
Where does this session values kept? In server or these session object is sent to Client along with the response?.
2) How do I get to know that user has closed the browser or moved to some other site, so that I can destroy session objects created for that user. And also it's important for me to know whether all user transactions are complete or not?
3) And how can track the keep track of the user if opens multiple browser window and does the transaction (a good example for this is usual Mails like yahoo or hotmail)

Thanks for any help
With warm regards :-
R.V. Holla
 
Brett Knapik
Ranch Hand
Posts: 255
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. it depends what you are tracking with. cookies both ( I believe) link tracking - webpage address hidden form - HTML content.
2. you set how long the session has been idle.
3. Its most likely they will have multiple sessions or if you set up a checking rountine to see if they are already logged in you can limit them to one session.
------------------
I wish there was a button on my monitor to turn up the intellegince.
Theres a button called 'brightness' but it doesn't work
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The key thing to remember about sessions is that only the "id" of the session is sent to the browser and back. All the session data and all the objects you put in it stay on the server. When a servlet or JSP accesses session data or puts/gets an object from the session, the servlet container uses the session id to find the stored data.
Some servlet containers store session data only in memory, some can store session data in files or in a database. Some can even share session data between multiple JVMs, but the objects in the session are never sent to the client.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic