title: JQuery - Ajax - Struts2 list
body: <p>Im looking for a little help on getting my JQuery/Ajax call to return a List from a Struts action and populate a DIV with the list elements using s:iterator.</p>
  
  <p>I have the following JQuery</p>
  
  <pre><code>   function lookupCustomerJs() {
          alert("lets start");
          $.ajax({  
              type: "POST",  
              url: "lookupCustomerAjax",  
              data: $('#lookupCustomer').serialize(), 
              success:function(response) {  
                  alert("do stuff");
                  $('div#custList').replaceWith($(response).find("div#custList"));
              },
              failure:function(response) {
                  alert('Ajax call failed');
              },
              error:function(response) {
                  alert(exception);
              }
          });  
      }
  </code></pre>
  
  <p>I have a DIV within my page which I then want to iterate the list through</p>
  
  <pre><code>                        &lt;div id="custList"&gt;
                              &lt;s:iterator status="stat" value="customerList" var="customer"&gt;
                                  &lt;s:param name="custFName" value="%{customer.firstname}" /&gt;
                              &lt;/s:iterator&gt;
                          &lt;/div&gt;
  </code></pre>
  
  <p>And my Action method which IS called, because when I debug, the debugger goes through the code.</p>
  
  <pre><code>private List&lt;Customer&gt; customerList;
  
  public String lookupCustomerAjax() {
  
      dummyData();
  
      return SUCCESS;
  }
  </code></pre>
  
  <p>This successully calls my Action method, but all I get is the "lets start" alert, then nothing else, no errors, nothing!</p>
  
  <p>So I'm guessing it's just the jQuery/Ajax success:function(response) {  not fireing correctly, but can't see why.</p>