Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.



Published on

Published in: Technology


  1. 1. @Andre_Mayer
  2. 2. wtf dwr? <ul><li>DWR¹ is a Java library that enables Java on the server and JavaScript in a browser to interact and call each other as simply as possible. </li></ul><ul><li>DWR is Easy Ajax² for Java </li></ul><ul><li>¹ Direct Web Remoting </li></ul><ul><li>²A synchronous J avascript a nd X ML </li></ul>
  3. 3. Joe Walker
  4. 4. <ul><li>DWR consists of two main parts: </li></ul><ul><ul><li>A Java Servlet running on the server that processes requests and sends responses back to the browser. </li></ul></ul><ul><ul><li>JavaScript running in the browser that sends requests and can dynamically update the webpage. </li></ul></ul>
  5. 5. <ul><li>DWR will generate the JavaScript to allow web browsers to call Java code . It can marshal virtually any data (using JSON) including collections, POJOs, XML and binary data like images and PDF files. </li></ul>
  6. 6. why use dwr? <ul><li>DWR will give you productivity by enabling you call your java classes/methods with very few lines of javascript code </li></ul>
  7. 7. script browser side <ul><li>Avoid complex XMLHttpRequest code, DOM manipulation, use DWR instead ;) </li></ul>
  8. 11. web.xml
  9. 12. dwr.xml <ul><li>This definitions will generate javascript file in runtime named Chat.js </li></ul>
  10. 14. 5
  11. 15. Chat.js
  12. 16. engine.js
  13. 18. it works!!
  14. 19. Advantages Disadvantages Easy integration between Java and JavaScript Only works in Java platform. Integrates with Spring Beans; Marshalling: JSON may be unsafe unless you are using unpredictable URLs. Real possibility to keep your MVC standard Going through not standard way in “transfer technologies” using AJAX (old-fashion) instead web sockets ( Integrates with leading Java Frameworks ( Spring, JSF, Hibernate) Debugging in console; Cross-browser