You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Paul Crabtree <Pa...@dna.co.uk> on 2003/12/03 12:28:53 UTC

[flow] accessing the real HttpServletRequest

Hi,

I'm trying to get access to the real HttpServletRequest from inside Flow
because i need to suck in the contents of a post into a Document using
getInputStream().

There doesnt seem to be a cocoon equivalent and in the StreamGenerator,
which has similar functionality it gets the real request from the
ObjectModel, something i cant seem to get either from within Flow.

Can anyone suggest a method for doing this?

Thanks in advance.
Paul.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: [flow] accessing the real HttpServletRequest

Posted by Guido Casper <gc...@s-und-n.de>.
Paul Crabtree wrote:
> Hi,
>
> I'm trying to get access to the real HttpServletRequest from inside
> Flow because i need to suck in the contents of a post into a Document
> using getInputStream().
>
> There doesnt seem to be a cocoon equivalent and in the
> StreamGenerator, which has similar functionality it gets the real
> request from the ObjectModel, something i cant seem to get either
> from within Flow.
>
> Can anyone suggest a method for doing this?

If you are fine with StreamGenerator,

var resolver =
cocoon.getComponent(Packages.org.apache.excalibur.source.SourceResolver.
ROLE);
var source =
resolver.resolveURI("cocoon:/pipelineContainingStreamGenerator");
var is = source.getInputStream();

should work.

HTH
Guido


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: [flow] accessing the real HttpServletRequest

Posted by Tony Collen <co...@umn.edu>.
Paul Crabtree wrote:
> Hi,
> 
> I'm trying to get access to the real HttpServletRequest from inside Flow
> because i need to suck in the contents of a post into a Document using
> getInputStream().
> 
> There doesnt seem to be a cocoon equivalent and in the StreamGenerator,
> which has similar functionality it gets the real request from the
> ObjectModel, something i cant seem to get either from within Flow.


Hmm, shouldn't this be enough:

http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/environment/http/HttpRequest.html#getInputStream()

?

Regards,

Tony


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: [flow] accessing the real HttpServletRequest

Posted by Reinhard Poetz <re...@apache.org>.
From: Paul Crabtree

> Hi,
> 
> I'm trying to get access to the real HttpServletRequest from 
> inside Flow because i need to suck in the contents of a post 
> into a Document using getInputStream().
> 
> There doesnt seem to be a cocoon equivalent and in the 
> StreamGenerator, which has similar functionality it gets the 
> real request from the ObjectModel, something i cant seem to 
> get either from within Flow.
> 
> Can anyone suggest a method for doing this?

Create your own special class and pass the Cocoon object to it. The
Cocoon object used within your own class has a method that returns the
Cocoon request object which can be casted to the HttpServletRequest.

If you use CVS head you can use "setupObject(yourObject)". This method
calls the various lifecycle methods you implement. This will be the
preferred way in the future (Cocoon 2.1.4) because it is cleaner from an
IoC point of view.
More infos in the Javadocs of
org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon.setupObject(
) and in the cocoon-dev archives - see
http://marc.theaimsgroup.com/?t=106934224400008&r=1&w=2

--
Reinhard


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: [flow] accessing the real HttpServletRequest

Posted by Mathieu Jean-Luc <je...@virtualys.com>.
Form setup method :
	(HttpServletRequest)objectModel.get(HttpEnvironment.HTTP_REQUEST_OBJECT)

Regards,
JL

> -----Message d'origine-----
> De : Paul Crabtree [mailto:Paul.Crabtree@dna.co.uk]
> Envoyé : mercredi 3 décembre 2003 12:29
> À : Cocoon Users (E-mail)
> Objet : [flow] accessing the real HttpServletRequest
>
>
> Hi,
>
> I'm trying to get access to the real HttpServletRequest from inside Flow
> because i need to suck in the contents of a post into a Document using
> getInputStream().
>
> There doesnt seem to be a cocoon equivalent and in the StreamGenerator,
> which has similar functionality it gets the real request from the
> ObjectModel, something i cant seem to get either from within Flow.
>
> Can anyone suggest a method for doing this?
>
> Thanks in advance.
> Paul.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org