Hello All i am using struts 2 and jquery plugin 1.8. Now i searche on google for using $.ajax()
methos in struts. but i thoing i am not typing right keywords. Can a
$.ajax({
type:'POST',
url:'ajaxAction?nodetitle='+title+'&filename='+fil,
dataType:'json',
success:function(data)
{
console.log(stringify(data));
}
});
Explanation
1.Type is method type: Get or Post.
2.url is where you want to redirect here ajaxAction it is an action java file where you want to redirect. and after ? nodetitle and filename is two arguments send to action page.
3.dataType is: in which format you want your data back. here in json format.
4.Success Function: if Data Comes Back Successfully. then we use Stringify method to get data or you use System.out.println on server.