Download USER GUIDE 5.2 - Courses on Java
Transcript
PrimeFaces User Guide
Exception Information
In the error page, information about the exception is provided via the pfExceptionHandler EL
keyword. Here is the list of exposed properties.
- exception: Throwable instance.
- type: Type of the exception.
- message: Exception message:
- stackTrace: An array of java.lang.StackTraceElement instances.
- formattedStackTrace: Stack trace as presentable string.
- timestamp: Timestamp as date.
- formattedTimestamp: Timestamp as presentable string.
In error page, exception metadata is accessed using EL;
<h:outputText value="Message:#{pfExceptionHandler.message}" />
<h:outputText value="#{pfExceptionHandler.formattedStackTrace}" escape="false" />
Ajax Exception Handler Component
A specialized exception handler component provides a way to execute callbacks on client side,
update other components on the same page. This is quite useful in case you don't want to create a
separate error page. Following example shows the exception in a dialog on the same page.
<p:ajaxExceptionHandler type="javax.faces.application.ViewExpiredException"
update="exceptionDialog" onexception="PF('exceptionDialog').show();" />
<p:dialog id="exceptionDialog" header="Exception: #{pfExceptionHandler.type}
occured!" widgetVar="exceptionDialog" height="500px">
Message: #{pfExceptionHandler.message} <br/>
StackTrace: <h:outputText value="#{pfExceptionHandler.formattedStackTrace}"
escape="false" />
<p:button onclick="document.location.href = document.location.href;"
value="Reload!"/>
</p:dialog>
Ideal location for p:ajaxExceptionHandler component is the facelets template so that it gets
included in every page. Refer to component documentation of p:ajaxExceptionHandler for the
available attributes.
Render Response Exceptions
To support exception handling in the RENDER_RESPONSE phase, it's required to set the
javax.faces.FACELETS_BUFFER_SIZE parameter. Otherwise you will probably see a
ServletException with "Response already committed" message.
584
Related documents
USER'S GUIDE 3.3
USER'S GUIDE 3.5 - Karolin Reinhardt
atlas manual de usuario componente combo de valores
PRIMEFACES MOBILE USER'S GUIDE
- San Diego State University
GiA Roots Manual
Demoiselle Nimble Guia do Usuário
Demoiselle Nimble Guia do Usuário
Guia do Usuário
Projecto em Engenharia Informatica
Configuration – Mode d`emploi Doozer
Hildeberto Mendonça Manoel Calixto Gerindo o