cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leszek Gawron <lgaw...@mobilebox.pl>
Subject Re: Action: How to get Request in initialize()?
Date Fri, 12 Aug 2005 19:07:08 GMT
Stefan Pietschmann wrote:
> Since this Action also extends ServiceableAction it would be even better 
> if I could get the Request in service() … but there I’m missing the 
> objectModel as well.
> 
>  
> 
> Stefan
> 
>  
> 
> ------------------------------------------------------------------------
> 
> *Von:* Stefan Pietschmann [mailto:dev.sensei@gmail.com]
> *Gesendet:* Freitag, 12. August 2005 11:00
> *An:* 'users@cocoon.apache.org'
> *Betreff:* Action: How to get Request in initialize()?
> 
>  
> 
> Hi,
> 
>  
> 
> I’m writing an Abstract Action to be used by other Actions, which shall 
> fetch things like the AuthenticationContext and the Request before act() 
> is called by the subclasses. So it implements Initializable and does 
> those things in initialize().
> 
>  
> 
> The problem is: in act() I have the objectModel to do something like 
> this: this.request = ObjectModelHelper.getRequest(objectModel);, however 
> I don’t have the objectModel in initialize()! How else could I get the 
> Request?
> 
>  
> 
> If this works, initialize() is called before act, and is there some 
> standard method that is called after act? I would use that to write 
> things back to the AuthenticationContext without the subclass needing to 
> call another method.
The only place you'll get is act() simply because all other methods are 
not invoked in request context. Only during act() the request is known. 
initialize() and service() are called when the component is being set up 
(basically when server starts although this is not that simple).

-- 
Leszek Gawron                                      lgawron@mobilebox.pl
IT Manager                                         MobileBox sp. z o.o.
+48 (61) 855 06 67                              http://www.mobilebox.pl
mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65

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


Mime
View raw message