Locale

Change the locale of the datepicker, schedule and client side validation messages.

Input Style

Free Themes

Built-in component themes created by the PrimeFaces Theme Designer.

PrimeOne Design

Saga Saga
Vela Vela
Arya Arya

Premium Themes

Premium themes are only available exclusively for PrimeFaces Theme Designer subscribers and therefore not included in PrimeFaces core.

bootstrap4-blue-light Bootstrap Blue
bootstrap4-purple-light Bootstrap Purple
bootstrap4-blue-dark Bootstrap Blue
bootstrap4-purple-dark Bootstrap Purple

Legacy Free Themes

Luna Amber Luna Amber
Luna Blue Luna Blue
Luna Green Luna Green
Luna Pink Luna Pink
Nova Nova
Nova Nova Alt
Nova Nova Accent

PREMIUM TEMPLATES

Create awesome applications in no time using the premium templates and impress your users.

ExceptionHandler

PrimeFaces provides a powerful ExceptionHandler out of the box with following features:

  • featuring support for AJAX and non-AJAX requests
  • ability to use error-page configuration in web.xml
  • an EL extension called #{pfExceptionHandler} to provide information about the exception
  • p:ajaxExceptionHandler component to customize AJAX exception handling on the current view

AJAX
Non-AJAX
Exception '' occured!
Message:
StackTrace:

<div class="card">
    <h:form>
        <h5 class="p-mt-0">AJAX</h5>
        <p:commandButton action="#{exceptionHandlerView.throwViewExpiredException}"
                         ajax="true"
                         value="Throw ViewExpiredException!" styleClass="p-mr-2" />
        <p:commandButton action="#{exceptionHandlerView.throwNullPointerException}"
                         ajax="true"
                         value="Throw NullPointerException!"/>
        <!-- IllegalStateException is not handled using ajaxExceptionHandlers below, so the error page is shown-->
        <p:commandButton action="#{exceptionHandlerView.throwWrappedIllegalStateException}"
                         ajax="true"
                         value="Throw IllegalStateException!" styleClass="p-mr-2"/>

        <h5>Non-AJAX</h5>
        <p:commandButton action="#{exceptionHandlerView.throwViewExpiredException}"
                         ajax="false"
                         value="Throw ViewExpiredException!" styleClass="p-mr-2"/>
        <!-- NullPointerException has no specific error-page defined in web.xml compared to ViewExpiredException -->
        <!-- https://github.com/primefaces/showcase-facelift/blob/master/src/main/webapp/WEB-INF/web.xml -->
        <p:commandButton action="#{exceptionHandlerView.throwNullPointerException}"
                         ajax="false"
                         value="Throw NullPointerException!"/>


        <p:ajaxExceptionHandler type="javax.faces.application.ViewExpiredException"
                                update="exceptionDialog"
                                onexception="PF('exceptionDialog').show()" />

        <p:ajaxExceptionHandler type="java.lang.NullPointerException"
                                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"/> <br/>

            <p:button onclick="document.location.href = document.location.href;"
                      value="Reload!"
                      rendered="#{pfExceptionHandler.type == 'javax.faces.application.ViewExpiredException'}"/>
        </p:dialog>
    </h:form>
</div>