You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Andrew Freeman <aw...@adelphia.net> on 2004/02/26 22:24:12 UTC

mapping an error-page to a Struts Action

I would like to be able to map my 404 errors to a specific Struts Action
versus mapping the error directly to a JSP page.  However, unless I
configure my Struts Action to forward to a Tiles definition I can't seem to
get this to work.  I am working with Tomcat 5.0.19 on Windows XP.

My config files:

	<!-- web.xml -->
	<error-page>
		<error-code>404</error-code>
		<location>/404.do</location>
	</error-page>


	<!-- struts-config.xml mapping that works -->
	<action path="/404" forward=".error.404" />

	<!-- struts-config.xml mapping that fails -->
	<action path="/404" forward="/404.jsp" />

If I call the 404.do directly, the page comes up correctly with with either
struts-config configuration.  If I use the first struts-config
configuration, the 404 page is displayed correctly.  However, if I use the
second struts-config configuration, I get a blank page when a 404 occurs.  I
give... Please tell me what I am doing wrong.

Thanks,
Andy


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