title: Primefaces ExceptionHandler not working as in the showcase
body: <p>I've tried the new ExceptionHandler tag in primefaces but it seems that I'm missing something with this tag.</p>
  
  <p>Basically my code is the same as in <a href="http://www.primefaces.org/showcase/ui/misc/exceptionHandler.xhtml" rel="nofollow noreferrer">http://www.primefaces.org/showcase/ui/misc/exceptionHandler.xhtml</a> , the problem is that adding this tag doesn't change anything I'm not getting any thing on client side.
  The standard js API is not working either with prime buttons:</p>
  
  <pre><code>jsf.ajax.addOnError(function(data) {alert('Error');})
  </code></pre>
  
  <p>The only difference I've noticed between my running app and Primefaces showcase is that the ajax response I get is different from the showcase's one:</p>
  
  <p>My response:</p>
  
  <p><img src="https://i.stack.imgur.com/hDm59.png" alt="enter image description here"></p>
  
  <p>showcases's response</p>
  
  <p><img src="https://i.stack.imgur.com/he5Ax.png" alt="enter image description here"></p>
  
  <p>here is  the code</p>
  
  <pre><code>&lt;h:form&gt;
  &lt;h3 style="margin-top:0"&gt;AJAX&lt;/h3&gt;
  &lt;p:commandButton actionListener="#{exceptionHandlerView.throwViewExpiredException}"
                   ajax="true"
                   value="Throw ViewExpiredException!" /&gt;
  &lt;p:commandButton actionListener="#{exceptionHandlerView.throwNullPointerException}"
                   ajax="true"
                   value="Throw NullPointerException!" /&gt;
  &lt;p:commandButton actionListener="#{exceptionHandlerView.throwWrappedIllegalStateException}"
                   ajax="true"
                   value="Throw IllegalStateException!" /&gt;
  
  &lt;h3&gt;Non-AJAX&lt;/h3&gt;
  &lt;p:commandButton actionListener="#{exceptionHandlerView.throwViewExpiredException}"
                   ajax="false"
                   value="Throw ViewExpiredException!" /&gt;
  &lt;p:commandButton actionListener="#{exceptionHandlerView.throwNullPointerException}"
                   ajax="false"
                   value="Throw NullPointerException!" /&gt;
  
  
  &lt;p:ajaxExceptionHandler type="javax.faces.application.ViewExpiredException"
                          update="exceptionDialog"
                          onexception="PF('exceptionDialog').show();" /&gt;
  
  &lt;p:ajaxExceptionHandler type="java.lang.NullPointerException"
                          update="exceptionDialog"
                          onexception="PF('exceptionDialog').show();" /&gt;
  
  &lt;p:dialog id="exceptionDialog" header="Exception '#{pfExceptionHandler.type}' occured!" widgetVar="exceptionDialog"
            height="500px"&gt;
      Message: #{pfExceptionHandler.message} &lt;br/&gt;
      StackTrace: &lt;h:outputText value="#{pfExceptionHandler.formattedStackTrace}" escape="false" /&gt; &lt;br /&gt;
  
      &lt;p:button onclick="document.location.href = document.location.href;"
                value="Reload!"
                rendered="#{pfExceptionHandler.type == 'javax.faces.application.ViewExpiredException'}" /&gt;
  &lt;/p:dialog&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>package org.primefaces.showcase.view.misc;
  
  
  import javax.faces.FacesException;
  import javax.faces.application.ViewExpiredException;
  import javax.faces.bean.ManagedBean;
  import javax.faces.bean.RequestScoped;
  import javax.faces.context.FacesContext;
  
  @ManagedBean
  @RequestScoped
  public class ExceptionHandlerView {
  
      public void throwNullPointerException() {
          throw new NullPointerException("A NullPointerException!");
      }
  
      public void throwWrappedIllegalStateException() {
          Throwable t = new IllegalStateException("A wrapped IllegalStateException!");
          throw new FacesException(t);
      }
  
      public void throwViewExpiredException() {
          throw new ViewExpiredException("A ViewExpiredException!",
                  FacesContext.getCurrentInstance().getViewRoot().getViewId());
      }
  }
  </code></pre>