cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Yeadon <scott.yea...@anu.edu.au>
Subject Re: Authentication and accessing the request object
Date Fri, 02 Jul 2004 04:44:47 GMT
That worked fine - Thanks.

I had a follow-on question for this. The following lines of code (within 
my authenticator class) did not enable me to obtain the attribute via 
Javascript (result was null) - javascript to get result was "var obj = 
cocoon.request.getAttribute("myAttr");"

        Request request = 
ObjectModelHelper.getRequest(ContextHelper.getObjectModel(this.context));
        request.setAttribute("myAttr", javaObject);

However the following did work (javascript to get result was "var obj = 
cocoon.session.getAttribute("myAttr");"):
        Request request = 
ObjectModelHelper.getRequest(ContextHelper.getObjectModel(this.context));
        Session session = request.getSession();
        session.setAttribute("myAttr", javaObject);

Does this mean that somewhere in the authentication framework the 
request object (or parts thereof) is possibly being rebuilt rather than 
forwarded?

Thanks.

Scott.


Ralph Goers wrote:

> The method recommended to me was to implement Contextualizable. In the 
> contextualize method save the context that is passed in. Then use:
>
> Map objModel = ContextHelper.getObjectModel(this.context);
>
> I'm using this in a source factory to get the request object.
>
> Ralph
>
> At 6/30/2004  08:35 PM, you wrote:
>
>> Hello,
>>
>> I have set up a basic authetication page using the 
>> authentication-manager and implementing the Authenticator interface 
>> with my own class, which works fine. However I need to pass 
>> information back via the request object within this class but the two 
>> parameters for Authenticator are of type SourceParameters and 
>> HandleConfiguration, neither of which provide me access to the 
>> request object nor allow me to utilise ObjectModelHelper in any way 
>> in order to obtain the request object. Is the only way I can 
>> accomplish this not to use the authentication model but instead break 
>> it down into separate actions which will allow me access to the 
>> request? I would rather not do this if possible. The relevant areas 
>> of my sitemap are shown below.
>
>
>
> ---------------------------------------------------------------------
> 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