How to call Struts2 Action method in ajax.Still now i worked to call servlet.is there any possibilities?if so please do share.
Update the struts.xml
as
jQuery code:
$.ajax({
url: "AJAXAction",
type: "POST",
data: {data: $('#txtbox').val()},
dataType: "json",
error: function(XMLHttpRequest, textStatus, errorThrown){
alert('Error ' + textStatus);
alert(errorThrown);
alert(XMLHttpRequest.responseText);
},
success: function(data){
alert('SUCCESS');
}
});