You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Willie Wheeler <ww...@andrew.cmu.edu> on 2000/07/20 22:48:58 UTC

[C2] Request scope in XSP

Hi all,

	Earlier today Carsten asked about Cocoon2 sessions, and the answer was that
they will be implemented in time.  I want to follow up by asking about
requests as well.  As you know, in JSP you can use the HttpServletRequest to
set and get attributes.  Will Cocoon2 also allow this capability, or is
there a different/preferred way to get the same functionality?  If the same
kind type of capability is planned, I think it would take all of five
minutes to implement--just add the relevant accessor methods to the
org.apache.cocoon.Request interface, implement them on the
CocoonServletRequest class, and then have it delegate to the
HttpServletRequest that it wraps (just like the other CocoonServletRequest
methods do)...

	Willie



Re: [C2] Request scope in XSP

Posted by Giacomo Pati <Gi...@pwr.ch>.
Willie Wheeler wrote:
> 
> Hi all,
> 
>         Earlier today Carsten asked about Cocoon2 sessions, and the answer was that
> they will be implemented in time.  I want to follow up by asking about
> requests as well.  As you know, in JSP you can use the HttpServletRequest to
> set and get attributes.  Will Cocoon2 also allow this capability, or is
> there a different/preferred way to get the same functionality?  If the same
> kind type of capability is planned, I think it would take all of five
> minutes to implement--just add the relevant accessor methods to the
> org.apache.cocoon.Request interface, implement them on the
> CocoonServletRequest class, and then have it delegate to the
> HttpServletRequest that it wraps (just like the other CocoonServletRequest
> methods do)...

It's already in place for the new, still not connected C2 version. See
under src/org/apache/cocoon/environment.

Giacom

-- 
PWR GmbH, Organisation & Entwicklung      Tel:   +41 (0)1 856 2202
Giacomo Pati, CTO/CEO                     Fax:   +41 (0)1 856 2201
Hintereichenstrasse 7                     Mailto:Giacomo.Pati@pwr.ch
CH-8166 Niederweningen                    Web:   http://www.pwr.ch

RE: [C2] Request scope in XSP

Posted by Willie Wheeler <ww...@andrew.cmu.edu>.
By the way, I guess that if you want a Java object to process your request
params instead of having the XSP do it directly, you can always make your
myJavaObj.process(Request req, Response res) method return a
locally-defined, and therefore request-scoped, java.util.Map, with the
processing results placed on the Map.  But it would be more convenient if
the attributes were available on the request, and it would facilitate the
transfer of JSP knowledge to XSP.

	Willie



-----Original Message-----
From: Mike Engelhart [mailto:mengelhart@earthtrip.com]
Sent: Thursday, July 20, 2000 4:50 PM
To: cocoon-dev@xml.apache.org
Subject: Re: [C2] Request scope in XSP


on 7/20/00 3:48 PM, Willie Wheeler at wwheeler@andrew.cmu.edu wrote:

> Hi all,
>
> Earlier today Carsten asked about Cocoon2 sessions, and the answer was
that
> they will be implemented in time.  I want to follow up by asking about
> requests as well.  As you know, in JSP you can use the HttpServletRequest
to
> set and get attributes.  Will Cocoon2 also allow this capability, or is
> there a different/preferred way to get the same functionality?  If the
same
> kind type of capability is planned, I think it would take all of five
> minutes to implement--just add the relevant accessor methods to the
> org.apache.cocoon.Request interface, implement them on the
> CocoonServletRequest class, and then have it delegate to the
> HttpServletRequest that it wraps (just like the other CocoonServletRequest
> methods do)...
>
> Willie

+1

I always pass objects around using the HttpServletRequest.get/setAttribute
methods.

Mike



Re: [C2] Request scope in XSP

Posted by Mike Engelhart <me...@earthtrip.com>.
on 7/20/00 3:48 PM, Willie Wheeler at wwheeler@andrew.cmu.edu wrote:

> Hi all,
> 
> Earlier today Carsten asked about Cocoon2 sessions, and the answer was that
> they will be implemented in time.  I want to follow up by asking about
> requests as well.  As you know, in JSP you can use the HttpServletRequest to
> set and get attributes.  Will Cocoon2 also allow this capability, or is
> there a different/preferred way to get the same functionality?  If the same
> kind type of capability is planned, I think it would take all of five
> minutes to implement--just add the relevant accessor methods to the
> org.apache.cocoon.Request interface, implement them on the
> CocoonServletRequest class, and then have it delegate to the
> HttpServletRequest that it wraps (just like the other CocoonServletRequest
> methods do)...
> 
> Willie

+1  

I always pass objects around using the HttpServletRequest.get/setAttribute
methods.

Mike