First, study case: Modify the page's data without refreshing the current page by changing the name on the getxml.jsp page.
Second, case study:struts and Ajax Coordination, mainly the definition of the return data. We can return data in JSON and XML format. Only the XML method is shown here .
A) format XML data, one is stitching strings, but in the case of many data, code maintenance is not. So here we are using dom4j. Put the downloaded dom4j.jar in the lib directory.
b) Create the scripts package and put the jquery.js in.
c) Create getxml.jsp pages, write html , and jquery.
d) Create Getinfoaction.java. and implement data formatting.
e) Configure the actionin struts.xml . Because we are Ajax requests, we do not need to refresh the page, so we do not configure result.
f) Note:
1. $ ("#bd table:eq (0)"). Remove (); in order to clear the form, or each additional will be more table.
2. The method return value in Action returns NULL. We have already written the data through response before we perform the return , so the return value here is meaningless.
3. the action in Struts.xml does not configure result.
Third, Experience:
A) asynchronous call mechanism is still relatively simple, about JSON Format data We are interested in self-Baidu. In the project, it is common for asynchronous calls to be implemented in a dwr plug-in if there are many places in the project to use . Use jquery If you have fewer words .
b) Although we are background developers, but simple jquery still has to be mastered, we can not say that just learn java , just learn java , in fact, there are a lot of things, we can probably understand, do not require mastery, will be used on the line.
Iv. Reference Items:
Five, a day of joy:
Today I saw a buddy's diary written on:
Dear wife, please, do not put the child's urine into the green tea bottle, the night shift I can't afford to hurt!
The final interpretation of the right to love Partner (www.23hhr.com) All, reproduced please indicate the source.
An explanation of the asynchronous invocation mechanism of STRUTS2