-----Original Message-----
From: Rhys Parry [mailto:[EMAIL PROTECTED]
Sent: April 25, 2006 1:51 PM
To: MyFaces Discussion
Subject: Problems with error pagesFirst I appologize for sending the last post to early :-P
All,
Many many problems.
First, what i wanted to do. . .
I wrapped myfaces FacesServlet( as it is final ) because I wanted to trap the error and email the admin once an error has occured with the stack trace.
Once I email I just wrap the exception in a ServletException and throw it.
The code looks like the following:
public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException
{
try
{
FACES_SERVLET.service( request, response );
}
catch( Throwable t )
{//wrap and throw
}
}
I also have the following in web.xml (there is also a 404):
<error-page>
<error-code>500</error-code>
<location>/grantiumError.jsf</location>
</error-page>
The problem seems to be that the error page is not rendering. Even if I remove my Servlet and use the Faces servlet I do not see my error page. What I see seems to be the output of the page that the error occured within. I am at my wits end here. It seems to be taking more effort than I should have to do. Note that we are using
org.apache.myfaces.application.jsp.JspTilesViewHandlerImpl to render struts tiles.
Any help would be greatly appreciated.
Rhys
Ok,
It
seems that if I use a static html page there is no problem in rendering the
view. Problem is that I want to provide my user with additional
information and would need faces to do it. Is the problem with faces
rendering the error response? It almost seems as though the component
model has not been updated/or (as the error is occurring during render response
phase) part of the message is written to the client.
To be
clear, the scenario listed below is the easiest version of this code.
Originally I was redirecting to the error page in the servlet. It seems
that as I tested this worked fine as I was manually throwing exceptions BEFORE
the render response cycle, however, if I did this during the render response
phase I was ending up in an endless loop.
Although the code is working statically, I would like to be able to
generate my error page using faces.
Any
comments welcome,
Rhys

