You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by An...@fiducia.de on 2006/08/30 06:59:55 UTC

Antwort: Re: Creating new Session without invalidating the old one [*]

Hello!


Thank you to all for your hints. Now, I want to tell you, what I did at last.

My application consists of nearly 100% forms. The application is logically
devided into two parts (-> represented by two browser windows), and it must be
possible to get from one part to the other. If somebody goes to the other part,
datas must be migrated from the first one, which needn't to be closed - it's
possible, that the user works with both parts at the same time.

To achieve these needs, I created an object in the ServletContext, where datas
are stored, which are needed to migrate from one session to another session. The
key to these data in this object is the session ID. If an user switches to
another part of the application, this is done using a direct call to a jsp, like

href=some.jsp;sessionid=E19593A3AB3BB4EBB92C6E64916B729C

I'm using sessionid (and not jsessionid), because this way, the request is
sessionless (I'm using URL-rewriting for session-tracking and https) and I can
check in the loginfilter myself, if the request belongs to an already logged in
user. If the sessionid is valid, the user gets a new one and I can fetch data
from the ServletContext-object.


Kind regards,
Andreas Hartmann


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Antwort: Re: Creating new Session without invalidating the old one [*]

Posted by David Durham <dd...@vailsys.com>.
Andreas.Hartmann@fiducia.de wrote:
> Hello!
> 
> 
> Thank you to all for your hints. Now, I want to tell you, what I did at last.
> 
> My application consists of nearly 100% forms. The application is logically
> devided into two parts (-> represented by two browser windows), and it must be
> possible to get from one part to the other. If somebody goes to the other part,
> datas must be migrated from the first one, which needn't to be closed - it's
> possible, that the user works with both parts at the same time.
> 
> To achieve these needs, I created an object in the ServletContext, where datas
> are stored, which are needed to migrate from one session to another session. The
> key to these data in this object is the session ID. If an user switches to
> another part of the application, this is done using a direct call to a jsp, like
> 
> href=some.jsp;sessionid=E19593A3AB3BB4EBB92C6E64916B729C
> 
> I'm using sessionid (and not jsessionid), because this way, the request is
> sessionless (I'm using URL-rewriting for session-tracking and https) and I can
> check in the loginfilter myself, if the request belongs to an already logged in
> user. If the sessionid is valid, the user gets a new one and I can fetch data
> from the ServletContext-object.


My thinking was to put 2 objects in a single session, each representing 
a respective window's attribute.  1 session, 2 "windows".

You could just have this new Window class extend HashMap to get 
key-value pairs.


-Dave

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org