struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rauf Khan" <forum.k...@gmail.com>
Subject Re: default error page with tiles?
Date Tue, 12 Sep 2006 04:28:26 GMT
Hi,

  I feel the solution is:

In web.xml
------------------------
<error-page>
   <error-code>404</error-code>   // this is only for 404 page not found
   <location>/error400.do</location>
</error-page>


In Struts-config.xml
---------------------------------
<action path="/error400" forward="error400page" />

In tiles-def.xml  specify the defination with name "error400page"

<definition name="error400page" extends=".someLayout">

----------- ------- ----- ---------- (add ur code)

</definition>

Hopes this will help u.

Regards

Khan

On 9/11/06, Darren Hall <dhall@utrs.com> wrote:

> Greetings,
>
> I'm using struts 1.2.9 with Tomcat 5.5 and Apache 2.2.
> Here's my issue -
> I'm looking to create a default error page for my application. One thing
> you
> should know... my application is using tiles. In my web.xml file I've
> added
> the following:
> <!-- The default error page -->
> <error-page>
>   <exception-type>java.lang.Exception</exception-type>
>   <location>flc.error</location>
> </error-page>
> "flc.error" is a template definition for a tile layout. I've created an
> intentional error in my struts-config.xml to a jsp file that doesn't
> exist.
> When I try to load the page with the invalid file name, I see the
> exception
> thrown in my logs then I see struts try to redirect to "/flc.error" -
> which
> is, of course, wrong since flc.error is not a file, but a layout
> definition.
> Is there a way to implement a default error page using tiles?
>
> Thanks,
>
> Darren
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message