Store Data in Session
I have gone through many threads on the internet to know how to store data in session
basically i searching for an actual replacement of the following code in spring 3 MVC
What i got from various sites that we can save data in session in 3 ways
HttpSession session = request.getSession();
1. Declare HttpSession object in the controller signature
2. Use @SessionAttribute. But this doesnt actually store the data in session, it stores the data in conversation way and loses it, when it losses the track of it.
3. Scope Session beans
So, which is the best way to store data in session ??
If you chooses to opt for Opt2, please explain its method