PDA

View Full Version : tracking active sessions?


prity
Jan 2nd, 2006, 02:46 PM
How to track active sessions through multiple pages invocation in spring. Meaning you always want to manipulate the data going from page 1 to page 2 to page 3 till user gets thing done and signs out.

My question is related to session handling in spring. you can consider a example like user purchasing several books on amazon.com visiting
several pages.
1>logging -in with userid password
2>visiting page 2, 3 and 4 making purchases and adding in shopping cart
3>And the finally paying by credit card
4>signing out

In such example you want to maintain that particular user session as he adds books in his cart and finally makes online payment

How to create user session and pass it through pages in Spring framework ? What Spring API on jsp, on server side and controller object side do I use ?

sample code snippet would definitly help.

Thanks again !
pp

Cowboy Bob
Jan 2nd, 2006, 07:09 PM
What's wrong with using the standard javax.servlet.http.HttpSession object?

Spring doesn't replace the standard Java servlet API, it runs on top of it and gives you access to the usual servlet objects in all the controllers and JSPs.

Bob

Colin Sampaleanu
Jan 2nd, 2006, 10:02 PM
If any part of the process is a defined set of pages with fixed flow relationships (i.e. they are not completely free-form), you should also consider using Spring Web Flow for that part of the site...