jQuery-Ajax-Struts2列表

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.

I have the following JQuery

   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);
            }
        });  
    }

I have a DIV within my page which I then want to iterate the list through

                        <div id="custList">
                            <s:iterator status="stat" value="customerList" var="customer">
                                <s:param name="custFName" value="%{customer.firstname}" />
                            </s:iterator>
                        </div>

And my Action method which IS called, because when I debug, the debugger goes through the code.

private List<Customer> customerList;

public String lookupCustomerAjax() {

    dummyData();

    return SUCCESS;
}

This successully calls my Action method, but all I get is the "lets start" alert, then nothing else, no errors, nothing!

So I'm guessing it's just the jQuery/Ajax success:function(response) { not fireing correctly, but can't see why.

It is probably the "lookupCustomerAjax" is an invalid url or file name. You should try adding the extension.

Also, for troubleshooting, you should console.log(response) in your succession to see that you are actually get the result.