I am confused on the following:
I can store a custom object for later usage inside the httpsession object.
Later usage I mean for usage by various servlets/filters during the same session.
Or I could use Spring session bean.
I was wondering (setting other parameters aside) would I gain any advantage by using the Spring’s session bean?
I am failing to see some importance difference.
You can inject other beans in the session bean.
If it is a simple value-holder, it doesn’t make much difference. But if you want to operate on those values (by invoking services), then having it as spring bean is beneficial.
Another plus is the fact that your code is not dependent on the servlet API. And it is easier to test.