struts2 ajax list集合,java - JQuery - Ajax - Struts2 list - Stack Overflow

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

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

private List 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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值