You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Adam Hardy <ah...@cyberspaceroad.com> on 2008/12/07 21:29:34 UTC

launching some code after action execution and before result

Is this possible somehow in the struts2 framework?

I'd like to execute some code for all requests after the action has executed, 
but before the result, the JSP and all are processed.

The code will look at the result type from the action and do some work based on 
that.

Something like an interceptor would be great, but obviously the interceptor 
framework doesn't enable me to do anything at that particular stage.

I am using Tiles and I guess a bit of research there will show up something I 
can employ, but I'd rather have the code logically nearer the Action class - 
actually on the action class would be ideal since that's where I already have 
the various managers and entities.


Thanks
Adam

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: launching some code after action execution and before result

Posted by Musachy Barroso <mu...@gmail.com>.
Use the @BeforeResult annotation:

http://struts.apache.org/2.0.14/struts2-core/apidocs/com/opensymphony/xwork2/interceptor/annotations/BeforeResult.html

musachy

On Sun, Dec 7, 2008 at 3:29 PM, Adam Hardy
<ah...@cyberspaceroad.com> wrote:
> Is this possible somehow in the struts2 framework?
>
> I'd like to execute some code for all requests after the action has
> executed, but before the result, the JSP and all are processed.
>
> The code will look at the result type from the action and do some work based
> on that.
>
> Something like an interceptor would be great, but obviously the interceptor
> framework doesn't enable me to do anything at that particular stage.
>
> I am using Tiles and I guess a bit of research there will show up something
> I can employ, but I'd rather have the code logically nearer the Action class
> - actually on the action class would be ideal since that's where I already
> have the various managers and entities.
>
>
> Thanks
> Adam
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: launching some code after action execution and before result

Posted by "Adam Hardy (struts)" <ah...@cyberspaceroad.com>.
Thanks for that. Don't know how I missed it in the documentation, it is of
course pretty much exactly what I need. 

Ideally I guess I'd like it to be configurable in the struts.xml, but it's
fine as it is. 



PreResultListener?


--- On Sun, 12/7/08, Adam Hardy <ah...@cyberspaceroad.com> wrote:

> From: Adam Hardy <ah...@cyberspaceroad.com>
> Subject: launching some code after action execution and before result
> To: "Struts Users Mailing List" <us...@struts.apache.org>
> Date: Sunday, December 7, 2008, 3:29 PM
> Is this possible somehow in the struts2 framework?
> 
> I'd like to execute some code for all requests after
> the action has executed, but before the result, the JSP and
> all are processed.
> 
> The code will look at the result type from the action and
> do some work based on that.
> 
> Something like an interceptor would be great, but obviously
> the interceptor framework doesn't enable me to do
> anything at that particular stage.
> 
> I am using Tiles and I guess a bit of research there will
> show up something I can employ, but I'd rather have the
> code logically nearer the Action class - actually on the
> action class would be ideal since that's where I already
> have the various managers and entities.
-- 
View this message in context: http://www.nabble.com/launching-some-code-after-action-execution-and-before-result-tp20885443p20898629.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: launching some code after action execution and before result

Posted by Dave Newton <ne...@yahoo.com>.
PreResultListener?


--- On Sun, 12/7/08, Adam Hardy <ah...@cyberspaceroad.com> wrote:

> From: Adam Hardy <ah...@cyberspaceroad.com>
> Subject: launching some code after action execution and before result
> To: "Struts Users Mailing List" <us...@struts.apache.org>
> Date: Sunday, December 7, 2008, 3:29 PM
> Is this possible somehow in the struts2 framework?
> 
> I'd like to execute some code for all requests after
> the action has executed, but before the result, the JSP and
> all are processed.
> 
> The code will look at the result type from the action and
> do some work based on that.
> 
> Something like an interceptor would be great, but obviously
> the interceptor framework doesn't enable me to do
> anything at that particular stage.
> 
> I am using Tiles and I guess a bit of research there will
> show up something I can employ, but I'd rather have the
> code logically nearer the Action class - actually on the
> action class would be ideal since that's where I already
> have the various managers and entities.
> 
> 
> Thanks
> Adam
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org