title: PrimeFaces 3.0 + Mojarra 2.1.6 javascript ajax package jsf.ajax.* not available - ViewExpiredException
body: <p>I've tried to investigate the problem but haven't found solution at all. I use primefaces datatable with pagination. I wrote and exception handler for viewexpiredexception error as Ed Burns suggested in his blog but when used in combiation with ajax submits (eg. datatable page navigation) the page redirection on vee is not handled. I used the solution suggested by BalusC here <a href="https://stackoverflow.com/questions/3556676/jsf-status-bar-connection-status-information">JSF Status bar / connection status information</a> but chrome says it's missing jsf.ajax.* javascript namespace. The page runs on tomcat 7.0.22 with no error/warning at startup and back-end is based on spring and mybatis. Here is the web.xml</p>
  
  <pre><code>&lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
      version="3.0"&gt;
      &lt;display-name&gt;Discontinui&lt;/display-name&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;/servlet-class&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;*.jsf&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;javax.servlet.jsp.jstl.fmt.localizationContext&lt;/param-name&gt;
          &lt;param-value&gt;resources.application&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;javax.faces.PROJECT_STAGE&lt;/param-name&gt;
          &lt;param-value&gt;Development&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;welcome-file-list&gt;
          &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
          &lt;welcome-file&gt;index.jsf&lt;/welcome-file&gt;
      &lt;/welcome-file-list&gt;
      &lt;listener&gt;
          &lt;listener-class&gt;org.springframework.web.util.Log4jConfigListener&lt;/listener-class&gt;
      &lt;/listener&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;/WEB-INF/applicationContext.xml&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;listener&gt;
          &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
      &lt;/listener&gt;
      &lt;listener&gt;
          &lt;listener-class&gt;org.springframework.web.context.request.RequestContextListener&lt;/listener-class&gt;
      &lt;/listener&gt;
      &lt;session-config&gt;
          &lt;session-timeout&gt;2&lt;/session-timeout&gt;
      &lt;/session-config&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>here is the faces-config.xml</p>
  
  <pre><code>&lt;faces-config
      xmlns="http://java.sun.com/xml/ns/javaee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
      version="2.0"&gt;
  
      &lt;application&gt;  
          &lt;el-resolver&gt;org.springframework.web.jsf.el.SpringBeanFacesELResolver&lt;/el-resolver&gt;  
      &lt;/application&gt; 
  
      &lt;factory&gt;
        &lt;exception-handler-factory&gt;it.dipvvf.vi.app.common.ViewExpiredExceptionExceptionHandlerFactory&lt;/exception-handler-factory&gt;
    &lt;/factory&gt;
  &lt;/faces-config&gt;
  </code></pre>
  
  <p>and here is the index.xhtml page:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1" ?&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"&gt;
  &lt;h:head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /&gt;
      &lt;title&gt;Prova&lt;/title&gt;
      &lt;script type="text/javascript"&gt;
      var statusUpdate = function statusUpdate(data) {
          var statusArea = document.getElementById("statusArea");
          var text = statusArea.value;
          text = text + "Name: "+data.source.id;
          if (data.type === "event") {
              text = text +" Event: "+data.name+"\n";
          } else {  // otherwise, it's an error
              text = text + " Error: "+data.name+"\n";
          }
          statusArea.value = text;
      };
  
      // Setup the statusUpdate function to hear all events on the page
      alert("0");
      jsf.ajax.addOnEvent(statusUpdate);
      alert("1");
      jsf.ajax.addOnError(statusUpdate);
      alert("2");
      &lt;/script&gt;
  &lt;/h:head&gt;
  &lt;h:body&gt;
      &lt;h:form&gt;
  Selezionare il tipo di accesso:&lt;br /&gt;
          &lt;p:selectOneMenu id="somAccessMode" value="#{accessMode.mode}"&gt;
              &lt;f:selectItem itemValue="#{accessMode.ufficioPersonale}"
                  itemLabel="Ufficio Personale" /&gt;
              &lt;f:selectItem itemValue="#{accessMode.capoTurno}"
                  itemLabel="Capo Turno" /&gt;
          &lt;/p:selectOneMenu&gt;
          &lt;br /&gt;
          &lt;p:commandButton id="bEnter" value="Entra"
              action="#{accessMode.onEntraClick}" update="growl" /&gt;
          &lt;br /&gt;
          &lt;p:dataTable var="nominativo" value="#{accessMode.elencoNominativi}" paginator="true" rows="1"  
                   paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                   rowsPerPageTemplate="5,10,15"&gt;
              &lt;p:column&gt;
                  &lt;f:facet name="header"&gt;  
                      Cognome  
                  &lt;/f:facet&gt;
                  &lt;h:outputText value="#{nominativo.cognome}" /&gt;
              &lt;/p:column&gt;
  
              &lt;p:column&gt;
                  &lt;f:facet name="header"&gt;  
                      Nome  
                  &lt;/f:facet&gt;
                  &lt;h:outputText value="#{nominativo.nome}" /&gt;
              &lt;/p:column&gt;
  
              &lt;p:column&gt;
                  &lt;f:facet name="header"&gt;  
                      Data Iscrizione  
                  &lt;/f:facet&gt;
                  &lt;h:outputText value="#{nominativo.iscrizione}"&gt;
                      &lt;f:convertDateTime pattern="dd-MM-yyyy" /&gt;
                  &lt;/h:outputText&gt;
              &lt;/p:column&gt;
          &lt;/p:dataTable&gt;
          &lt;hr /&gt;
          &lt;br /&gt;
          &lt;!-- &lt;p:messages showDetail="true" autoUpdate="true"/&gt;   --&gt;
          &lt;p:growl id="growl" showDetail="true" sticky="true" /&gt;
          &lt;h3&gt;Status:&lt;/h3&gt;
          &lt;textarea id="statusArea" cols="40" rows="10" readonly="readonly" /&gt;
      &lt;/h:form&gt;
  &lt;/h:body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I've put more than needed just for tests. The alert("1") and "2" does not show and jsf.ajax.add... raise error in browser. If I look and generated page in chrome I can't see any inclusion of jsf.js bundled into mojarra package. Where is the flaw?</p>
  
  <p>Thanks to anyone and sorry for the lenght!</p>