You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Stuart Ellidge <st...@adaptris.com> on 2009/05/01 16:52:17 UTC

REST Plugin and PreResultListeners

Hi all,

In our application an interceptor registers a PreResultListener to perform some common calculation prior to rendering the page. The reason this is handled in a PreResultListener is that the action may well modify the basis for the calculation and we need to include the most recent result of it in the display.

This all worked very nicely with the REST plugin until we came to implement a JSON request... unfortunately, it appears that the JSON result is rendered directly directly to the Response output stream, prior to the execution of any PreResultListeners.

I was wondering if anyone else had encountered this issue and, if so, how they had resolved it. If not, I would be happy enough to implement an alternative ContentTypeHandlerManager that could fire off the PreResultListeners if need be; however, I'm not sure how to retrieve the registered listeners and how to subsequently remove them after execution!

Thanks in advance for any help
Regards
Stuart

Re: REST Plugin and PreResultListeners

Posted by Wes Wannemacher <we...@wantii.com>.
On Saturday 02 May 2009 12:47:38 pm dusty wrote:
>
> The REST plugin needs a steward(stuart).  Don (original author) has been
> too busy to work on it and I think most of the current committers are happy
> with the current REST function or are working on other things.  Maybe you
> are the one!?
>

I currently don't use REST for any of my projects, but would be glad to apply 
patches, etc. I know there are a few other committers using REST, but busy, so 
feel free to post patches in JIRA, they'll be incorporated.

-Wes

-- 

Wes Wannemacher
Author - Struts 2 In Practice 
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher


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


Re: REST Plugin and PreResultListeners

Posted by Stuart Ellidge <st...@adaptris.com>.
Thanks for replying Dustin / Wes,

I'll see where I get to with this and if I can possibly submit something reusable, I'll certainly do so.

Regards
Stuart

On 02/05/2009 17:47, "dusty" <du...@yahoo.com> wrote:



Are you registering the listener in the action or interceptor.  Does it
matter or both fail?

The REST plugin needs a steward(stuart).  Don (original author) has been too
busy to work on it and I think most of the current committers are happy with
the current REST function or are working on other things.  Maybe you are the
one!?




Stuart Ellidge wrote:
>
> Hi all,
>
> In our application an interceptor registers a PreResultListener to perform
> some common calculation prior to rendering the page. The reason this is
> handled in a PreResultListener is that the action may well modify the
> basis for the calculation and we need to include the most recent result of
> it in the display.
>
> This all worked very nicely with the REST plugin until we came to
> implement a JSON request... unfortunately, it appears that the JSON result
> is rendered directly directly to the Response output stream, prior to the
> execution of any PreResultListeners.
>
> I was wondering if anyone else had encountered this issue and, if so, how
> they had resolved it. If not, I would be happy enough to implement an
> alternative ContentTypeHandlerManager that could fire off the
> PreResultListeners if need be; however, I'm not sure how to retrieve the
> registered listeners and how to subsequently remove them after execution!
>
> Thanks in advance for any help
> Regards
> Stuart
>
>

--
View this message in context: http://www.nabble.com/REST-Plugin-and-PreResultListeners-tp23334431p23348144.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: REST Plugin and PreResultListeners

Posted by dusty <du...@yahoo.com>.
Are you registering the listener in the action or interceptor.  Does it
matter or both fail?  

The REST plugin needs a steward(stuart).  Don (original author) has been too
busy to work on it and I think most of the current committers are happy with
the current REST function or are working on other things.  Maybe you are the
one!?




Stuart Ellidge wrote:
> 
> Hi all,
> 
> In our application an interceptor registers a PreResultListener to perform
> some common calculation prior to rendering the page. The reason this is
> handled in a PreResultListener is that the action may well modify the
> basis for the calculation and we need to include the most recent result of
> it in the display.
> 
> This all worked very nicely with the REST plugin until we came to
> implement a JSON request... unfortunately, it appears that the JSON result
> is rendered directly directly to the Response output stream, prior to the
> execution of any PreResultListeners.
> 
> I was wondering if anyone else had encountered this issue and, if so, how
> they had resolved it. If not, I would be happy enough to implement an
> alternative ContentTypeHandlerManager that could fire off the
> PreResultListeners if need be; however, I'm not sure how to retrieve the
> registered listeners and how to subsequently remove them after execution!
> 
> Thanks in advance for any help
> Regards
> Stuart
> 
> 

-- 
View this message in context: http://www.nabble.com/REST-Plugin-and-PreResultListeners-tp23334431p23348144.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