cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jos Snellings <Jos.Snelli...@pandora.be>
Subject Re: HttpServletRequest from Flowscript
Date Tue, 14 Jun 2011 05:31:35 GMT
Well, that seems indeed like a rather complex way to achieve a simple thing.

How about this:
- 2.1 still has a horse called "xsp", which is a scripting language 
ensuring nicely balanced tags. Like an "xml-ized" jsp.
   an xsp page has direct access to request data, and you have access to 
pages. I can send you an example.
- in 3 there is no xsp anymore (it got accused of witchcraft or so ;-) ).

Cheers,
Jos

On 06/13/2011 12:12 PM, Paul Joseph wrote:
> Hi Jos,
>
> Thank your for your reply--I am using that old workhourse,  Cocoon 2.1 
> (.11)
>
> I find that there it appears to be not that simple at all.  I use 
> flowscript and Java and am trying to implement Windows Single SIgn On 
> with SPNEGO.
>
> The issue is that it needs HttpServletRequest while all I have in the 
> flowscript is cocoon.request which is not the same.
>
> I found the following method on the web.
>
> a) get the application context (avalon)
>
>     public void contextualize(Context context) throws ContextException {
>             objectModel = ContextHelper.getObjectModel(context);
>     }
>
>
> b) then with the objectModel, we can do:
>         final HttpServletRequest httpRequest = (HttpServletRequest) 
> objectModel.get(HttpEnvironment.HTTP_REQUEST_OBJECT);
>
>
> Good...but my problem is simple and after many hours I still don't 
> know how to do this:
>
> How does one access the Avalon context in Javascript and then pass it 
> to the Java layer?
>
> Now after much reading I find that I should probably write an Action 
> and use the sitemap to fire the action.  I gather the sitemap will 
> automatically make the objectmodel available to my action code and 
> then I can proceed as in step b above.  My only problem is I have 
> never written or used an action and so am a bit wary.
>
> rgds
> Paul
>
> On 6/13/2011 12:00 AM, Jos Snellings wrote:
>> Hi Paul,
>>
>> C3 or C2.2?
>> In cocoon-3 you may want to use:
>>
>> import org.apache.cocoon.servlet.util.HttpContextHelper;
>>
>> HttpServletRequest request;
>>
>> public void setup(Map<String, Object> parameters) {
>>
>>     request = HttpContextHelper.getRequest(parameters);
>>     }
>> from within a cocoon generator.
>>
>> Cheers,
>> Jos
>>
>> On 06/12/2011 07:01 PM, Paul Joseph wrote:
>>> Hi there,
>>>
>>> Does anyone know how one can pass the Cocoon request to a java 
>>> function that needs to use HttpServletRequest?
>>>
>>> I passed in the cocoon.request  to the Java function using but 
>>> inside the Java code I am not able to cast the cocoon request to the 
>>> HttpServletRequest.
>>>
>>> Any guidance would be appreciated.
>>>
>>> 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
>>
>>
>
> ---------------------------------------------------------------------
> 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


Mime
View raw message