struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Newton <>
Subject Re: Getting rid of session state
Date Mon, 01 Nov 2010 13:09:35 GMT
I guess I'd examine what you're trying to remove from session, and why.

Mechanisms like ViewState are just session, really, but stored
somewhere else, either directly in an encoded string, or using it as a
key to look of values stored somewhere else, which means it might as
well be in session, no?

Whether or not keeping something in the request depends on if it's
only needed in the request; Spring can scope things from/to the
request, as can various other mechanisms.

Storing items in the DB per-request is fine as long as you're either
(a) caching aggressively, or (b) don't care about performance. Noting
that sessions can be stored in a database.

Scope interceptor is just another mechanism for deciding what goes
into session and when it should be removed. I find it a little clunky
for really fine-grained stuff, but haven't fully explored its
capabilities and how to configure it in a way I actually like.

So, what specific problems are you trying to solve?


On Mon, Nov 1, 2010 at 9:02 AM, Greg Akins <> wrote:
> I'm developing a new Struts2 application, am new to Struts2, and want
> to reduce my dependency on the session.
> What kind of "best practices" are folks using to move the type of
> information that needs to be persisted during a session to other
> mechanisms?
> I can think of a few.. does anyone have any other ideas, or is there
> just a standard Struts2 way to do this?
> 1.  Implementing something similar to ViewState in aspx
> 2.  Managing values by manually keeping them in the request
> 3.  Storing everything in a db and looking it up with each request
> 4.  Scope Interceptor
> --
> Greg Akins
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message