You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Juan B. Rodriguez" <jb...@gmx.net> on 2004/09/25 18:36:03 UTC
Session Customization
Hello everyone, I'm just starting out with Java/Struts from a previous
development environment.
I would like to customize the default session behaviour by doing the
following:
1. Customized Session Id
I want to generate my own id (mostly as a cookie, I don't think I'd like
to encourage URL rewriting).
This id will be signed as to prevent any tampering, using a secret token
message digest.
2. Database storage
I'd like the session id and corresponding name/value pairs to be stored
in a backend database, rather than in the container memory (except
perhaps for some sort of caching).
So, now I'm unsure about the best way to proceed
1) Filters ?
I've been looking into filters to accomplish. Read some articles that
show something like what I need, but there's a lot of coding involved.
I'd really like to adhere to the KISS principle here.
2) Replacing ActionServlet, Wrapping Response/Request/Session objects
Looks like a possibility, I've yet to get a picture of how this might work.
3) Custom Session
Write my own classes that would substitue for req.GetSession.
I'd really appreciate your input on how you're approaching this issues
with the experience you have.
Thanks in advance.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Session Customization
Posted by Craig McClanahan <cr...@gmail.com>.
You'll need to modify your servlet container to accomplish any of
these goals ... there's nothing you can do at the web application
level.
One thing you'll find more complex than expected is wanting to save
session attributes in the database. Remember that session attributes
can be any arbitrary object, not just strings.
Craig
On Sat, 25 Sep 2004 11:36:03 -0500, Juan B. Rodriguez
<jb...@gmx.net> wrote:
> Hello everyone, I'm just starting out with Java/Struts from a previous
> development environment.
>
> I would like to customize the default session behaviour by doing the
> following:
>
> 1. Customized Session Id
> I want to generate my own id (mostly as a cookie, I don't think I'd like
> to encourage URL rewriting).
> This id will be signed as to prevent any tampering, using a secret token
> message digest.
>
> 2. Database storage
> I'd like the session id and corresponding name/value pairs to be stored
> in a backend database, rather than in the container memory (except
> perhaps for some sort of caching).
>
> So, now I'm unsure about the best way to proceed
>
> 1) Filters ?
> I've been looking into filters to accomplish. Read some articles that
> show something like what I need, but there's a lot of coding involved.
> I'd really like to adhere to the KISS principle here.
>
> 2) Replacing ActionServlet, Wrapping Response/Request/Session objects
> Looks like a possibility, I've yet to get a picture of how this might work.
>
> 3) Custom Session
> Write my own classes that would substitue for req.GetSession.
>
> I'd really appreciate your input on how you're approaching this issues
> with the experience you have.
>
> Thanks in advance.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org