0

I have pretty old EE application that is using the JSF 1.1.8, MyFaces and Facelets. The application is running on the Websphere 8.5. I'm using exception handling in my web.xml like this:

<error-page>
    <exception-type>java.lang.Throwable</exception-type>
    <location>/error.html</location>
</error-page>

But instead of redirection to the error page, quite often I have the situation when the error page HTML is just added to the page where the exception appears. So the final page looks like the start of the page that I requested, but not up to the end, because than the exception appears and than goes the HTML for the error page.

So my question is how to avoid it? Any ideas how to force JSF make the redirect?

Tiny
  • 27,221
  • 105
  • 339
  • 599
serg
  • 1,003
  • 3
  • 16
  • 26
  • 1
    Apparently the exception was thrown while rendering the response (bad practice! do business logic before rendering the response), and the response is already committed while MyFaces isn't checking that. I don't have a JSF 1.1 + Facelts 1.x playground project at hands now, but try increasing `facelets.BUFFER_SIZE` context param to a value which should exceed the largest HTML response you have. This way MyFaces must be able to reset the response body. – BalusC Jan 16 '15 at 18:23
  • Big thanks BalusC, your solution worked for us!!! And especially thanks for you comment about invoking the business logic during the render response, maybe it is something obvious, but before it we won't even think about it. Now we see that is problem – serg Jan 19 '15 at 11:09

0 Answers0