The principle of DWR:
One, what is DWR?
DWR: (Direct Web Remoting) is an open-source class library that helps developers develop Web sites that contain Ajax technology. It allows code (JavaScript) in the browser to use Java functions running on the WEB server as if it were in the browser .
It consists of two main parts:
A. Allow JavaScript to get data from a servlet (small application) that adheres to Ajax principles on the Web server.
B. Its JavaScript library can help Web site developers easily use the data they get to dynamically change the content of the page.
Second, the principle of work and its advantages and disadvantages
How DWR works:
Call to the corresponding Dwrservlet via the requested URL
Dwrservlet load corresponding dwr.xml, convert the corresponding class into JS code, send to the browser client's call, via JS Ajax package
Advantages:
1. Browser compatible:
2.json Package
3. Conversion of multiple objects (SSH object conversion)
4. Can write less JS code, do more things
Disadvantages:
- It's not easy to find mistakes
- DWR configuration is complex
The principles and advantages and disadvantages of DWR