Welcome to the new Spring.io forums!
If this is your first visit, be sure to check out the
by clicking the link above, and for security reasons, use the
forgot password link to reset your password..
You may have to register before you can post: click the register
link above to proceed. To start viewing messages, select the forum that you want to visit
from the selection below.
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.