You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Mueller, Franz" <fr...@sapmarkets.com> on 2001/04/10 15:09:40 UTC

ActionServlet doesn't react when Action returns null

Hello all,

my impression is, when an Action returns null like:
   
   ActionForward forward = mapping.findForward("some_forward");     // this
forward is not declared in the configuration file !!!
   return forward;  // return null;


the ActionServlet does not react propper.  It does not handle this
situation.

Wouldn't it be better to return a  HTTP-Error ?

Best regards, fm


Re: ActionServlet doesn't react when Action returns null

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Tue, 10 Apr 2001, Mueller, Franz wrote:

> Hello all,
> 
> my impression is, when an Action returns null like:
>    
>    ActionForward forward = mapping.findForward("some_forward");     // this
> forward is not declared in the configuration file !!!
>    return forward;  // return null;
> 
> 
> the ActionServlet does not react propper.  It does not handle this
> situation.
> 
> Wouldn't it be better to return a  HTTP-Error ?
> 
> Best regards, fm
> 
> 

A null return value from your Action is essentially saying "my Action has
created the response already, so there is no need to forward anywhere
else."  This is documented in the JavaDocs for the
<code>Action.perform()</code> method.

Craig