1 / 14

DWR: Direct Web Remoting

Explore how DWR, a Java and JavaScript open-source library, simplifies Ajax web applications through direct remoting, reverse Ajax, and generating dynamic JS from Java classes. Learn the advantages, supported environments, and browser compatibility.

zielinski
Download Presentation

DWR: Direct Web Remoting

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Rajesh R rajeshranganathan@cevalsoft.com DWR: Direct Web Remoting

  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

More Related