Possible Duplicate:
How use $.ajax() method in struts2
simply,
1.can sombody tell me how to call a struts action through jquery ajax?(not struts jquery plugin)
2.and how can get results and how can send html output(result) to a target div correctly?
3.should we change the result types in struts configurations?
4.how to run javascript after ajax content have loaded?
5.and any other things i should have known about struts actions regarding jquery ajax and javascript running.
please somebody can share a best reference for this or clean answer.
Although you can find bits and pieces of this information on the net easily. Let’s put it at same page.
Ans 1::Include the js file of JQuery and Write your ajax call.
});
That is for sending JSON and retrieving JSON from action class.
Configuration of JSON can be found here along with other answers
Ans 2::
If you want to show only part of the loaded HTML(converted JSP) , use
Ans 3:: It all depends on what you want . You have to configure if you want pdf or other thing.
a) Whole JSP
b) Working with streams and setting content through ActionClass only
Method::
c) With JSON as result. (struts2-json plugin)
d) PDF
Ans::4. Thats all JQuery In success/done/deferred callbacks you can put your js
Example snippet::