Presentation is loading. Please wait.

Presentation is loading. Please wait.

DWR: Direct Web Remoting

Similar presentations


Presentation on theme: "DWR: Direct Web Remoting"— Presentation transcript:

1 DWR: Direct Web Remoting
Rajesh R

2 DWR:Agenda What is DWR? Why DWR? Reverse AJAX Advantages

3 What is DWR? Is a Java and JavaScript open source library which allows you to write Ajax web applications Specifically designed with Java technology in mind > “Easy AJAX for Java” Allows JavaScript code in a browser to use Java methods running on a web server just as if they were in the browser > Why it is called “Direct remoting”

4 Why DWR? Without DWR, you would have to create many Web application endpoints (servlets) that need to be address'able via URI's What happens if you have several methods in a class on the server that you want to invoke from the browser? > Each of these methods need to be addressable via URI whether you are using XMLHttpRequest directory or client side only toolkit such as Dojo or Prototype > You would have to map parameters and return values to HTML input form parameters and responses yourself DWR comes with some JavaScript utility functions

5 Ingredients A Java Servlet running on the server that processes incoming DWR requests and sends responses back to the browser. JavaScript running in the browser that sends requests and can dynamically update the webpage

6 JS to Java

7 Reverse Ajax Reverse Ajax is the biggest new feature in DWR 2.0
It gives you the ability to asynchronously send data from a web- server to a browser.

8 Java to JS: Reverse Ajax
allows Java code running on the server to find out what clients are viewing certain pages, and to send to them JavaScript, generated either manually or using a Java API

9 Dynamic JS DWR generates dynamic JS based on the Java Classes
The DWR Engine then does some Ajax magic to make it feel like the execution is happening on the browser, but in reality the server is executing the code and DWR is marshalling the data back and forwards.

10 Advantages Call Java Functions like RMI or Soap
Automatically create Java versions of JS Expose business methods through JS

11 Supported Environment
DWR requires JDK1.3 or later Tomcat Weblogic Websphere Jboss Etc…

12 Browser Support Firefox 1.0 and above Internet Explorer 6.0 and above
Opera 8.0 and above Safari 1.3 and above

13 Queries

14 Thanks! Rajesh


Download ppt "DWR: Direct Web Remoting"

Similar presentations


Ads by Google