cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Joseph <pjos...@gmail.com>
Subject Re: HttpServletRequest from Flowscript
Date Tue, 14 Jun 2011 10:59:15 GMT
Hi Jos,

I pulled out my old Cocoon book by Mathew Langham and Carsten Ziegeler 
and found that there is a racehorse in the stable called Action.

On pp. 250 of this book they have a simple example on how to implement 
an "action" and I did that and lo and behold all works now.

I was trying to implement Single Sign On in the Cocoon app against 
Microsoft Active directory and to save others that trouble I shall 
writeup post how I did it.

Thanks again for all your help.

Paul


On 6/14/2011 1:31 AM, Jos Snellings wrote:
> 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
>
>

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


Mime
View raw message