You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Martin Morawetz <ma...@kreativezone.at> on 2006/01/19 15:57:48 UTC

Struts creates its own session object?

Hi,

We have two web applications, a Struts-application
and a strutsless application.

Both web applications have to use the same session.

It appears that both apps do have a session with
the same id, but the session-objects are different
and so all the attributes the two session-objects
contain.
These session-objects exist at the same time.

Does Struts provide it's own session object? And
if so how can I share the session between the
two apps? I depend on the objects stored in the
session of the strutsless app.

As it may be important to the problem:
These two web applications run on two different
subdomains of our domain. To be able to use the same
session for both applications we specified a cookie
domain (Feature of the Resin Servlet-Engine).
This feature works fine except for the strutspowered
app.

--
Regards

Martin

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


Re: Struts creates its own session object?

Posted by Vikrama Sanjeeva <vi...@gmail.com>.
Hi,

  Thanks for the good explanation.

Bye,
Viki.

On 1/19/06, Craig McClanahan <cr...@apache.org> wrote:
>
> On 1/19/06, Martin Morawetz <ma...@kreativezone.at> wrote:
> >
> > Hi,
> >
> > We have two web applications, a Struts-application
> > and a strutsless application.
> >
> > Both web applications have to use the same session.
>
>
> This is not possible, either with or without Struts.  The servlet
> specification requires that the sessions for each web application be
> independent of each other.
>
> When you think about this a little, it is easy to understand the reasons
> for
> this restriction.  The most important one is that the classes visible to
> each application are different, because each app loads its own
> WEB-INF/classes and WEB-INF/lib directories.  Therefore, even if the
> session
> object were shared, a session attribute stored by webapp A might not be
> usable by webapp B, simply because webapp B cannot see the class for that
> object since it exists only in webapp A.
>
> You will need to use a strategy other than sharing sessions to share
> information between these two apps.
>
> Craig
>
>

Re: Struts creates its own session object?

Posted by Craig McClanahan <cr...@apache.org>.
On 1/19/06, Martin Morawetz <ma...@kreativezone.at> wrote:
>
> Hi,
>
> We have two web applications, a Struts-application
> and a strutsless application.
>
> Both web applications have to use the same session.


This is not possible, either with or without Struts.  The servlet
specification requires that the sessions for each web application be
independent of each other.

When you think about this a little, it is easy to understand the reasons for
this restriction.  The most important one is that the classes visible to
each application are different, because each app loads its own
WEB-INF/classes and WEB-INF/lib directories.  Therefore, even if the session
object were shared, a session attribute stored by webapp A might not be
usable by webapp B, simply because webapp B cannot see the class for that
object since it exists only in webapp A.

You will need to use a strategy other than sharing sessions to share
information between these two apps.

Craig