14
DWR: Direct Web Remoting Rajesh R [email protected]

DWR: Direct Web Remoting

  • Upload
    tiva

  • View
    39

  • Download
    0

Embed Size (px)

DESCRIPTION

Rajesh R [email protected]. DWR: Direct Web Remoting. DWR:Agenda. What is DWR? Why DWR? Reverse AJAX Advantages. 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 - PowerPoint PPT Presentation

Citation preview

Page 1: DWR:  Direct Web Remoting

DWR: Direct Web Remoting

Rajesh [email protected]

Page 2: DWR:  Direct Web Remoting

DWR:Agenda

What is DWR? Why DWR? Reverse AJAX Advantages

Page 3: DWR:  Direct Web Remoting

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”

Page 4: DWR:  Direct Web Remoting

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

Page 5: DWR:  Direct Web Remoting

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

Page 6: DWR:  Direct Web Remoting

JS to Java

Page 7: DWR:  Direct Web Remoting

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.

Page 8: DWR:  Direct Web Remoting

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

Page 9: DWR:  Direct Web Remoting

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.

Page 10: DWR:  Direct Web Remoting

Advantages

Call Java Functions like RMI or Soap Automatically create Java versions of

JS Expose business methods through JS

Page 11: DWR:  Direct Web Remoting

Supported Environment

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

Page 12: DWR:  Direct Web Remoting

Browser Support

Firefox 1.0 and above Internet Explorer 6.0 and above Opera 8.0 and above Safari 1.3 and above

Page 13: DWR:  Direct Web Remoting

Queries

Page 14: DWR:  Direct Web Remoting

Thanks!

Rajesh