Well, you could replace the OutputStream in the response with an
OutputStream that will just buffer the response.  But that may
increase user-perceived latency because it will take so long for the
first byte to come back.  If your application can handle just doing
the work before the final render of the page, you could build a new
BasePage object that implements BeginRenderListener and then call a
method in your custom ApplicationServlet from within beginRender(). 
But that requires knowledge about what the ApplicationServlet by your
Tapestry app, which is a bad thing, in general.  Replacing the output
stream is certainly easiest.

--sam


On 3/13/06, Adam Zimowski <[EMAIL PROTECTED]> wrote:
> Hi
>
> I extended ApplicationServlet to do some non-Tapestry work. From my
> servlet I need to set a persistent cookie after super.doGet, but when
> Tapestry's doGet is finished response is already committed and my
> setting a cookie does not take effect:
>
> @Override
> public void doGet(HttpServletRequest aRequest, HttpServletResponse
> aResponse) throws IOException, ServletException {
>  super.doGet(aRequest, aResponse);
>  // need to add cookie here
> }
>
> Obviously if I do super last I would be able to add a cookie, but then
> I know nothing about things that are interesting to me, like if
> session is new, etc.
>
> So how can I go about creating a cookie at the end of super.doGet ?
>
> -adam
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to