geoff,
you're right! i moved the create-session attribute to the first map:part in
the aggregation you saw in my example. i did the same in another nearly
identical aggregation in my sitemap. now i'm able to access the session
from within the particular map:part where i wanted to in the first place.
i don't quite understand why this change made it work, though. my only
clues are:
1.) by accessing the session in the first map:part, i've somehow enabled
session access in a later map:part that otherwise wouldn't have
been able to access the session successfully.
2.) the IllegalStateException was telling me that i "Cannot create a
session
after the response has been committed."
each map:part invokes a matcher similar to this one:
<map:match pattern="choose_item.products">
<map:generate type="serverpages" src="xsp/choose_item.products.xsp"/>
<map:serialize type="xml"/>
</map:match>
does the map:serialize "commit" the response? is that what the error
message is
talking about?
thanks!
Mike Lenyon
----- Original Message -----
From: "Geoff Howard" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, May 27, 2003 12:10 PM
Subject: Re: problems tracking session from page to page
> I think the issue is the aggregation. to test, go directly to the
> general.currentproduct pipeline (with the create-session attr. in).
> If that works, try to move it to the first map:part if you can as
> a workaround. A better solution would be to look into the session
> actions that will ensure you have created your session before the
> pipeline starts generating.
>
> HTH,
> Geoff
>
> At 08:56 AM 5/27/2003, you wrote:
> >hi geoff,
> >
> >yes, i've tried putting create-session in the xsp:page tag. but i still
get
> >the IllegalStateException. as you're probably aware, having
create-session
> >causes the following line to appear at the beginning of the generate()
> >method:
> >
> >Session session = request.getSession(true);
> >
> >that's the line that the exception refers to.
> >
> >here's a snippet from my sitemap to exemplify one of the two pages where
to
> >problem occurs:
> >
> > <map:match pattern="choose_item.html">
> > <map:aggregate element="page">
> > <map:part src="cocoon:/choose_item.products"/>
> > <map:part src="cocoon:/general.productcategories"/>
> > <map:part src="cocoon:/common"/>
> > <map:part src="cocoon:/general.currentproduct"/>
<!--
> >only page that accesses session -->
> > </map:aggregate>
> > <map:transform type="xslt" src="style/choose_item.xsl"/>
> > <map:transform type="i18n"/>
> > <map:serialize type="html"/>
> > </map:match>
> >
> >does that provide any useful clues?
> >
> >thanks in advance.
> >
> >Mike Lenyon
> >----- Original Message -----
> >From: "Geoff Howard" <[EMAIL PROTECTED]>
> >To: <[EMAIL PROTECTED]>
> >Sent: Tuesday, May 27, 2003 8:22 AM
> >Subject: Re: problems tracking session from page to page
> >
> >
> > > But I think the problem is that your code is working with the
> > > session after processing starts and attempting there to create
> > > a session after it's too late. Have you tried the create-session
> > > attribute yet?
> > >
> > > Geoff Howard
> > >
> > > At 07:05 AM 5/27/2003, you wrote:
> > > >antonio,
> > > >
> > > >thanks for your response, but please look at what i'm saying:
> > > >
> > > ><xsp:page
> > > > language="java"
> > > > xmlns:xsp="http://apache.org/xsp"
> > > > xmlns:xsp-request="http://apache.org/xsp/request/2.0"
> > > > xmlns:xsp-session="http://apache.org/xsp/session/2.0">
> > > >
> > > >causes the error message:
> > > >java.lang.IllegalStateException: Cannot create a session after the
> >response
> > > >has been committed
> > > >
> > > >in other words, not having create-session="true" doesn't matter.
simply
> > > >having
> > > > xmlns:xsp-session="http://apache.org/xsp/session/2.0" causes the
> > > >problem.
> > > >
> > > >Mike Lenyon
> > > >----- Original Message -----
> > > >From: "Antonio Gallardo" <[EMAIL PROTECTED]>
> > > >To: <[EMAIL PROTECTED]>
> > > >Sent: Tuesday, May 27, 2003 1:49 AM
> > > >Subject: Re: problems tracking session from page to page
> > > >
> > > >
> > > > > Hi:
> > > > >
> > > > > I dont remember if changed from default. Before the default was
create
> >a
> > > > > new session. Now I think this is not the default.
> > > > >
> > > > > Please try to use:
> > > > > xmlns:xsp-session="http://apache.org/xsp/session/2.0"
> > > >create-session="true"
> > > > >
> > > > > Best Regards,
> > > > >
> > > > > Antonio Gallardo
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > >
> > > > >
> > > >
> > > >
> > > >---------------------------------------------------------------------
> > > >To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > >For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]