This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.
No announcement yet.
Managing objects being held in sessionPage Title Module
I personally try to put as few stuff as possible in the session. The main reasons are from a user perspective. I would rather be able to bookmark pages & send links that directly open a specifc page, and if I fork a session (Open link in a new page/tab), then I don't want changes in one page/tab mess with the other one.
I forgot too, putting stuff in the session scope might create issue when using back too. Also, to avoid problems with back button and refresh, I use GETs anytime an operation doesn't modify the database, and when I use POST, I never display directly a page, I always use a redirect to a GET.
I'm not sure I really understand your question, but when I want information to be passed from one request to another I add the minimum needed to every link (i.e. IDs), so that I can retrieve the data before handling the request, with the data possibly cached somewhere.
Concerning when to put stuff in the HttpSession, I usually only do that when the data is user specific. For example, items in a shopping cart are user specific, while a search result could be meaningful for anyone.
Not quite sure my answer is useful, since I'm unsure what kind of answer you were looking for, but I hope it helps.