PDA

View Full Version : How to interact between Ext.Ajax and JSP?



edwardking
14 Sep 2010, 6:40 PM
I use Ajax to submit some message,code is follows:



test.jsp is follows:





When I run above code,it should alert xml information,but it only alert blank information. I don't find any document about interacting between Ext.Ajax and JSP. How to correct above code?

Thanks

crysfel
14 Sep 2010, 9:30 PM
you should use the "success" and "failure" callbacks:



Ext.Ajax.request({
url : "test.jsp",
params :{name:"Edward",sex:"Male"},
success : function(response,options){
//everything is ok :)
console.debug(response.responseXML);
},
failure : function(){
//something fail :(
}
});
alert(_response.responseXML);