The error page defined in web.xml is embedded in the partially displayed JSF page

I have the following definition in web.xml:

<error-page>
    <exception-type>java.lang.Throwable</exception-type>
    <location>/shared/errors/DefaultErrorPage.xhtml</location>
</error-page>
<error-page>
    <exception-type>javax.faces.application.ViewExpiredException</exception-type>
    <location>/shared/errors/ViewExpired.xhtml</location>
</error-page>

I also use FullAjaxExceptionHandler from Omnifaces in faces-config.xml:

<factory>
    <exception-handler-factory>
        org.omnifaces.exceptionhandler.FullAjaxExceptionHandlerFactory
    </exception-handler-factory>
</factory>

FullAjaxExceptionHandler works fine for ajax calls, but when I click the page directly and an error appears, it starts to render the page I tried to go to, but it does not end, and then a specific error page in the web.xml file, which leads to the error page is embedded after the partially displayed page.

(I am using Glassfish 3.1.1 with Mojarra JSF 2.1.3) Editing: now using Glassfish 3.1.2.2 and JSF 2.1.11

: : , , - (<ui:composition template="/shared/shared/commonLayout.xhtml">). , , , .

+5
1

, , . , ServletOutputStream#flush() JSF, - , , ( 2 ) . - . . 2 :

  • .
  • .

Glassfish, -, . . - HTML-, , enduser, , webbrowser , HTML-.

, JSF, , . -, ? ? - , ? <f:event type="preRenderView"> .

<f:event type="preRenderView" listener="#{bean.init}" />

- , , HTML, . , , HTML 100 :

<context-param>
    <param-name>javax.faces.FACELETS_BUFFER_SIZE</param-name>
    <param-value>102400</param-value><!-- 100KB -->
</context-param>
+5

All Articles