title: Ajax not working JSF 2.2
body: <p>I'm using JSF 2.2 with TomCat 6. When I execute an ajax function the fields are not updated. I created a new project with just one controller and page even so, the ajax calls doesn't work.
  It calls the method but doesn't update the page.</p>
  
  <pre class="lang-xhtml prettyprint-override"><code>    &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:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j" xmlns:ajax="https://ajax4jsf.dev.java.net/ajax"&gt;
  
  &lt;h:head&gt;
  &lt;/h:head&gt;
  &lt;h:body&gt;
  
      &lt;h:form id="formTest"&gt;
          &lt;h:outputLabel value="#{teste.teste}" id="testando" /&gt;
          &lt;h:inputText value="#{teste.teste}" /&gt;
          &lt;a4j:commandButton action="#{teste.agir}" render="formTest" execute="formTest" /&gt;
  
      &lt;/h:form&gt;
  &lt;/h:body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>@ManagedBean(name = "teste")
  @SessionScoped
  public class Teste {
  
  private String teste = "oi";
  
  public void agir() {
  teste = "666666";
  System.out.println(getTeste());
  }
  
  public String getTeste() {
  return teste;
  }
  
  public void setTeste(String teste) {
  this.teste = teste;
  }
  }
  </code></pre>
  
  <p>web.xml</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"     xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"&gt;
        &lt;display-name&gt;Try&lt;/display-name&gt;
        &lt;welcome-file-list&gt;
          &lt;welcome-file&gt;index.jsf&lt;/welcome-file&gt;
  
        &lt;/welcome-file-list&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;description&gt;State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2&lt;/description&gt;
          &lt;param-name&gt;javax.faces.STATE_SAVING_METHOD&lt;/param-name&gt;
          &lt;param-value&gt;client&lt;/param-value&gt;
        &lt;/context-param&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;listener&gt;
         &lt;listener-class&gt;com.sun.faces.config.ConfigureListener&lt;/listener-class&gt;
       &lt;/listener&gt;
      &lt;/web-app&gt;
  </code></pre>