SlideShare a Scribd company logo
1 of 16
AJAX With DWR(Direct Web Remoting) GouthamV Software Engineer InfoGroup
    AJAX (Asynchronous JavaScript And Xml) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
AJAX architecture with toolkits
  Examples of AJAX GMail Google Maps Google Suggest Flickr
AJAX implementation toolkits  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Why DWR? Most commonly used toolkit in java environment according to Google and Burton Group (research and advisory services in IT architecture and infrastructure decisions)   Java to JavaScript marshalling and vice versa Integrates best with Spring! Uses JavaScript objects also called JSON(Java Script Object Notation)
Why JSON? Lightweight data-interchange format  Easy for humans to read and write Easy for machines to parse and generate var myJSONObject = { "web":[ { "name": "html",   "years": "5"   },   { "name": "css",   "years": "3"   }]   } JSON Vs XML: Light and Faster than XML. JSON types: String, number, array, boolean but XML all strings. Reading values from JSON object is same as java object, but  reading XML needs tedious DOM APIs.
DWR architecture with example
OE example with DWR   (Existing problem) ,[object Object],[object Object],[object Object],[object Object],[object Object]
  DWR  configuration steps 1.Copy dwr.jar to lib folder 2. Add DWR servlet details in web.xml 3. Create dwr.xml in web-inf folder to configure DWR 4. Write Java classes that dwr will use for Ajax functionality 5. Call methods of those classes from Java script.
Sample DWR Servlet ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
DWR and Spring  Tighter integration with Spring   No more dwr.xml but ordinary Spring XML  DWR controller (instead of DWR Servlet) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
DWR Advanced features Batching: beginBatch() make some dwr request endBatch() Accessing servlet parameters: WebContext ctx = WebContextFactory.get(); ctx.getHttpServletRequest(); ctx.getHttpServletResponse(); ctx.getServletContext(); GMail style loading messages  DWRUtil.useLoadingMessage(‘Waiting…’);
DWR  Scriptaculous  Dojo  Prototype  1.  Java-exclusive  -- seems to be Java code that generates JavaScript. This limits its utility in non-Java environments.  1.  No IE5.x support  1.Documentation is lacking. 2. Client has to include large size javascript files. 1.IE support is  limited to IE6. 2. No documenta- tion other than  Readme!!. 3. Has no visual  effects library.  1.  Good integration with Java.  2.  Extensive documentation  . 3.  Integration with projects (Spring, XOM, Dom4J)  1.  Lots of neat visual effects.  2. Simple and easy to understand object-oriented design.   1.Browser compatibility targets are: IE,FireFox,Safari.  2.Core parts are unit tested, has good visual effects 1.It can be used in any environment.  2. Foundation for other toolkits. 3. Provides fairly low-level access to XMLHttpRequest.  C O N S P R O S
Conclusion  DWR improves the user experience.  Integrates nicely with Spring.  Testing DWR functionality is easy by setting debug to true.   Hides XMLHttpRequest javascript implementation.   Can be used along with other UI toolkits(eg. Scriptaculous,  Dojo…)  etc…
DWR Resources  Ajax Hacks(ch 5), Bruce W.Perry, O’Reilly.  JDJ,  OCT-06  Issue. http://bram.jteam.nl/files/dwr_and_spring.pdf . www.ajaxload.info   (loading panel gifs)

More Related Content

What's hot

Adventures in Multithreaded Core Data
Adventures in Multithreaded Core DataAdventures in Multithreaded Core Data
Adventures in Multithreaded Core Data
Inferis
 

What's hot (20)

Java script tutorial
Java script tutorialJava script tutorial
Java script tutorial
 
NodeJS ecosystem
NodeJS ecosystemNodeJS ecosystem
NodeJS ecosystem
 
Servlet and JSP
Servlet and JSPServlet and JSP
Servlet and JSP
 
Web Development with AngularJS, NodeJS and ExpressJS
Web Development with AngularJS, NodeJS and ExpressJSWeb Development with AngularJS, NodeJS and ExpressJS
Web Development with AngularJS, NodeJS and ExpressJS
 
JS Event Loop
JS Event LoopJS Event Loop
JS Event Loop
 
JavaScript 101
JavaScript 101JavaScript 101
JavaScript 101
 
RxJS and Reactive Programming - Modern Web UI - May 2015
RxJS and Reactive Programming - Modern Web UI - May 2015RxJS and Reactive Programming - Modern Web UI - May 2015
RxJS and Reactive Programming - Modern Web UI - May 2015
 
Introduction To JavaScript
Introduction To JavaScriptIntroduction To JavaScript
Introduction To JavaScript
 
Ng init | EPI Sousse
Ng init | EPI SousseNg init | EPI Sousse
Ng init | EPI Sousse
 
2310 b 13
2310 b 132310 b 13
2310 b 13
 
Brubeck: The Lightning Talk
Brubeck: The Lightning TalkBrubeck: The Lightning Talk
Brubeck: The Lightning Talk
 
Introduction to node.js aka NodeJS
Introduction to node.js aka NodeJSIntroduction to node.js aka NodeJS
Introduction to node.js aka NodeJS
 
Module design pattern i.e. express js
Module design pattern i.e. express jsModule design pattern i.e. express js
Module design pattern i.e. express js
 
JavaScript Good Practices
JavaScript Good PracticesJavaScript Good Practices
JavaScript Good Practices
 
Fullstack LX - Improving your application performance
Fullstack LX - Improving your application performanceFullstack LX - Improving your application performance
Fullstack LX - Improving your application performance
 
Dmp hadoop getting_start
Dmp hadoop getting_startDmp hadoop getting_start
Dmp hadoop getting_start
 
Node js
Node jsNode js
Node js
 
MongoDB's New Aggregation framework
MongoDB's New Aggregation frameworkMongoDB's New Aggregation framework
MongoDB's New Aggregation framework
 
Node.js and Cassandra
Node.js and CassandraNode.js and Cassandra
Node.js and Cassandra
 
Adventures in Multithreaded Core Data
Adventures in Multithreaded Core DataAdventures in Multithreaded Core Data
Adventures in Multithreaded Core Data
 

Viewers also liked

Framework MVC - vRaptor
Framework MVC - vRaptorFramework MVC - vRaptor
Framework MVC - vRaptor
Édipo Souza
 

Viewers also liked (6)

Framework MVC - vRaptor
Framework MVC - vRaptorFramework MVC - vRaptor
Framework MVC - vRaptor
 
Dwr
DwrDwr
Dwr
 
Introducing dwr (direct web remoting)
Introducing dwr (direct web remoting)Introducing dwr (direct web remoting)
Introducing dwr (direct web remoting)
 
Wicket 10 years and beyond
Wicket   10 years and beyond Wicket   10 years and beyond
Wicket 10 years and beyond
 
Minicurso groovy grails
Minicurso groovy grailsMinicurso groovy grails
Minicurso groovy grails
 
Apache Click
Apache ClickApache Click
Apache Click
 

Similar to Ajax with DWR

Java Script - A New Look
Java Script - A New LookJava Script - A New Look
Java Script - A New Look
rumsan
 
Jwis2011 ruo ando
Jwis2011 ruo andoJwis2011 ruo ando
Jwis2011 ruo ando
Ruo Ando
 

Similar to Ajax with DWR (20)

MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)
MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)
MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)
 
Zepto and the rise of the JavaScript Micro-Frameworks
Zepto and the rise of the JavaScript Micro-FrameworksZepto and the rise of the JavaScript Micro-Frameworks
Zepto and the rise of the JavaScript Micro-Frameworks
 
Java Script - A New Look
Java Script - A New LookJava Script - A New Look
Java Script - A New Look
 
Java on Windows Azure
Java on Windows AzureJava on Windows Azure
Java on Windows Azure
 
node.js 실무 - node js in practice by Jesang Yoon
node.js 실무 - node js in practice by Jesang Yoonnode.js 실무 - node js in practice by Jesang Yoon
node.js 실무 - node js in practice by Jesang Yoon
 
JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4
 
Get Ahead with HTML5 on Moible
Get Ahead with HTML5 on MoibleGet Ahead with HTML5 on Moible
Get Ahead with HTML5 on Moible
 
Tangram
TangramTangram
Tangram
 
J Query
J QueryJ Query
J Query
 
Intro to mobile web application development
Intro to mobile web application developmentIntro to mobile web application development
Intro to mobile web application development
 
Caerusone
CaerusoneCaerusone
Caerusone
 
Event-driven IO server-side JavaScript environment based on V8 Engine
Event-driven IO server-side JavaScript environment based on V8 EngineEvent-driven IO server-side JavaScript environment based on V8 Engine
Event-driven IO server-side JavaScript environment based on V8 Engine
 
Dojo - from web page to web apps
Dojo - from web page to web appsDojo - from web page to web apps
Dojo - from web page to web apps
 
Jwis2011 ruo ando
Jwis2011 ruo andoJwis2011 ruo ando
Jwis2011 ruo ando
 
Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]
 
Javascript Frameworks Comparison - Angular, Knockout, Ember and Backbone
Javascript Frameworks Comparison - Angular, Knockout, Ember and BackboneJavascript Frameworks Comparison - Angular, Knockout, Ember and Backbone
Javascript Frameworks Comparison - Angular, Knockout, Ember and Backbone
 
Open Source Web Technologies
Open Source Web TechnologiesOpen Source Web Technologies
Open Source Web Technologies
 
Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007
 
Advanced JavaScript
Advanced JavaScriptAdvanced JavaScript
Advanced JavaScript
 
CTS Conference Web 2.0 Tutorial Part 2
CTS Conference Web 2.0 Tutorial Part 2CTS Conference Web 2.0 Tutorial Part 2
CTS Conference Web 2.0 Tutorial Part 2
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

Ajax with DWR

  • 1. AJAX With DWR(Direct Web Remoting) GouthamV Software Engineer InfoGroup
  • 2.
  • 4. Examples of AJAX GMail Google Maps Google Suggest Flickr
  • 5.
  • 6. Why DWR? Most commonly used toolkit in java environment according to Google and Burton Group (research and advisory services in IT architecture and infrastructure decisions) Java to JavaScript marshalling and vice versa Integrates best with Spring! Uses JavaScript objects also called JSON(Java Script Object Notation)
  • 7. Why JSON? Lightweight data-interchange format Easy for humans to read and write Easy for machines to parse and generate var myJSONObject = { "web":[ { "name": "html", "years": "5" }, { "name": "css", "years": "3" }] } JSON Vs XML: Light and Faster than XML. JSON types: String, number, array, boolean but XML all strings. Reading values from JSON object is same as java object, but reading XML needs tedious DOM APIs.
  • 9.
  • 10. DWR configuration steps 1.Copy dwr.jar to lib folder 2. Add DWR servlet details in web.xml 3. Create dwr.xml in web-inf folder to configure DWR 4. Write Java classes that dwr will use for Ajax functionality 5. Call methods of those classes from Java script.
  • 11.
  • 12.
  • 13. DWR Advanced features Batching: beginBatch() make some dwr request endBatch() Accessing servlet parameters: WebContext ctx = WebContextFactory.get(); ctx.getHttpServletRequest(); ctx.getHttpServletResponse(); ctx.getServletContext(); GMail style loading messages DWRUtil.useLoadingMessage(‘Waiting…’);
  • 14. DWR Scriptaculous Dojo Prototype 1. Java-exclusive -- seems to be Java code that generates JavaScript. This limits its utility in non-Java environments. 1. No IE5.x support 1.Documentation is lacking. 2. Client has to include large size javascript files. 1.IE support is limited to IE6. 2. No documenta- tion other than Readme!!. 3. Has no visual effects library. 1. Good integration with Java. 2. Extensive documentation . 3. Integration with projects (Spring, XOM, Dom4J) 1. Lots of neat visual effects. 2. Simple and easy to understand object-oriented design. 1.Browser compatibility targets are: IE,FireFox,Safari. 2.Core parts are unit tested, has good visual effects 1.It can be used in any environment. 2. Foundation for other toolkits. 3. Provides fairly low-level access to XMLHttpRequest. C O N S P R O S
  • 15. Conclusion DWR improves the user experience. Integrates nicely with Spring. Testing DWR functionality is easy by setting debug to true. Hides XMLHttpRequest javascript implementation. Can be used along with other UI toolkits(eg. Scriptaculous, Dojo…) etc…
  • 16. DWR Resources Ajax Hacks(ch 5), Bruce W.Perry, O’Reilly. JDJ, OCT-06 Issue. http://bram.jteam.nl/files/dwr_and_spring.pdf . www.ajaxload.info (loading panel gifs)