You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Russell Neufeld <ru...@hds.com> on 2009/04/29 23:12:22 UTC

Sending back HTML with Struts 2 while shutting down the server

Hi all,

    One of the struts actions I'm implementing shuts down the server.  
I'd like to be able to send back an HTML response before the server 
shuts down, but the action's execute() method doesn't dispatch to the 
jsp for the html response until after the return of the method.  That 
means if I start my shutdown sequence before returning from execute(), 
there's a race and the response HTML may not make it back to the browser.

    In Struts 1 (which I realize is a different framework) I manually 
called the request dispatcher in the execute() method to first return an 
HTML response, and then I started the shutdown sequence.  Can I do the 
same thing in Struts 2?  Is there a special value I can return from a 
Struts 2 execute() method, say null, which tells the framework not to 
send any HTML response back (because I've already done that manually 
with a request dispatcher)?

    Thanks,

       Russ

Re: Sending back HTML with Struts 2 while shutting down the server

Posted by Russell Neufeld <ru...@hds.com>.
Thanks Dave.  Worked like a charm.

Dave Newton wrote:
> Russell Neufeld wrote:
>   
>> One of the struts actions I'm implementing shuts down the server.
>>     
>
> Hmm.
>
>   
>> Is there a special value I can return from a Struts 2 execute()
>>     
>  > method, say null, which tells the framework not to send any HTML
>  > response back [...]
>
> Try "none" (Action.NONE)
>
> Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>   


Re: Sending back HTML with Struts 2 while shutting down the server

Posted by Dave Newton <ne...@yahoo.com>.
Russell Neufeld wrote:
> One of the struts actions I'm implementing shuts down the server.

Hmm.

> Is there a special value I can return from a Struts 2 execute()
 > method, say null, which tells the framework not to send any HTML
 > response back [...]

Try "none" (Action.NONE)

Dave


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