What is DWR ?)

Source: Internet
Author: User

DWR is short for Direct Web remoting.

DWR (Direct Web remoting) is a web Remote Call framework that makes Ajax development very simple.

DWR is an open-source solution using the Apache license protocol. It contains the server-side Java library, a DWR servlet, and a javascript library. Although DWR is not the only available Ajax-RPC toolkit on the Java platform, it is the most mature and provides many useful functions.
From the simplest point of view, DWR is an engine that can expose methods of server-side Java objects to JavaScript.Code. Using DWR can effectivelyProgramEliminate all Ajax request-response loops in the code. This means that the client Code no longer needs to directly process the XMLHTTPRequest object or server response. You no longer need to compile Object serialization code or use a third-party tool to convert an object into XML. You do not even need to write servlet code to adjust Ajax requests to call Java domain objects.
DWR is deployed as a servlet in a web application. Think of it as a black box. This servlet has two main functions: first, for each public class, DWR dynamically generates JavaScript contained in the web page. The generated JavaScript contains the stub function, representing the corresponding methods in the Java class and executing XMLHttpRequest behind the scenes. These requests are sent to DWR. At this time, its second role is to translate the requests into method calls on the server-side Java object and put the return values of the methods in the servlet response and send them back to the client, encode it into JavaScript. DWR also provides JavaScript tool functions to help you execute common user interface tasks.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.