You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by meeboo <de...@gmail.com> on 2007/05/16 11:59:41 UTC

Redirecting from mapping error exceptions

Hey all

I have the following lines in Struts.xml

<global-results>
    	<result name="error">/index</result>
</global-results>
<global-exception-mappings>
    	<exception-mapping result="error" exception="java.lang.Throwable"/>
</global-exception-mappings>

But it won't catch exceptions where the user has typed in an unmapped
address, all I get is
There is no Action mapped for namespace / and action name xxx (with status
report 500)

Can I somehow redirect all these exceptions to my index page?

Thanks!
-- 
View this message in context: http://www.nabble.com/Redirecting-from-mapping-error-exceptions-tf3763683.html#a10638948
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: Redirecting from mapping error exceptions

Posted by Ignacio de Córdoba <ic...@skios.es>.
Hello,
2 years now from your question I wonder if you solved this. I'd like to do
exactly the same thing... redirecting any non existing action or error from
the user when entering the actin URL to the home page. (I mean, any 404
error)

At first I thought about using httpd error handling for this, but struts2
standard mapping now maps "everything" to the struts2 filter, even static
content, so now I get the "There is no Action..." error for any non existing
URL in my site. I guess that means Struts has to handle it or to change the
configuration and make struts2 handle only .action calls (which is complex
as there are a lot of .js, images, etc. now in struts jars which would have
to be uncompressed)


meeboo wrote:
> 
> Hey all
> 
> I have the following lines in Struts.xml
> 
> <global-results>
>     	<result name="error">/index</result>
> </global-results>
> <global-exception-mappings>
>     	<exception-mapping result="error" exception="java.lang.Throwable"/>
> </global-exception-mappings>
> 
> But it won't catch exceptions where the user has typed in an unmapped
> address, all I get is
> There is no Action mapped for namespace / and action name xxx (with status
> report 500)
> 
> Can I somehow redirect all these exceptions to my index page?
> 
> Thanks!
> 

-- 
View this message in context: http://www.nabble.com/Redirecting-from-mapping-error-exceptions-tp10638948p25939426.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