The Artima Developer Community
Sponsored Link

Java Community News
Direct Web Remoting (DWR) 2.0 Reaches First Milestone Build

1 reply on 1 page. Most recent reply: Apr 19, 2006 6:28 AM by maninder batth

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Frank Sommers

Posts: 2642
Nickname: fsommers
Registered: Jan, 2002

Direct Web Remoting (DWR) 2.0 Reaches First Milestone Build Posted: Apr 18, 2006 8:24 AM
Reply to this message Reply
Summary
Direct Web Remoting (DWR) allows browser-based JavaScript to interact with Java classes on the server, and to control page content with results from the server, making it easy to AJAX-enable a Java Web app. The biggest new feature of 2.0 is "reverse Ajax," allowing the server to send asynchronous calls back to the client.
Advertisement

The Direct Web Remoting (DWR) project on java.net provides an open source library to help develop Ajax web sites with Java on the server.

DWR consists of a server-side component—a Java servlet that processes requests from a browser and sends replies back to the browser, and JavaScript functions that run inside a browser that interact with the servlet and update the contents of the page based on results from the server.

DWR works like an RPC mechanism: JavaScript code running in the browser can invoke Java "methods" as if the Java classes defining those methods resided in the browser's address space. DWR takes care of dispatching those invocations to the server, including marshalling the request and the response. Moreover, DWR dynamically generates JavaScript based on Java class definitions. The result is somewhat similar to Java RMI, but because the client-side uses JavaScript, the client requires no applets or plugins.

DWR's 1.0 and 1.1 releases extended a typically asynchronous AJAX server-side invocation with a listener mechanism: The client can register a listener when it invokes a server-side function, and when the server responds, that listener notifies client-side code of the response contents.

Many rich-client applications—and most non-trivial apps with an HTML UI as well—require some form of client-side state. For instance, displaying a set of inventory items in an HTML table means that the browser, in effect, maintains a client-side cache of the displayed items. The same issue holds for a Swing application that maintains a data model behind each Swing component. A key aspect of architecting such applications is to ensure synchronization between the client- and server-sides of the application's state.

DWR version 2.0's biggest new feature helps achieve such synchronization for AJAX apps: "reverse Ajax" lets the server make asynchronous calls back to the client. For instance, if the server-side state of an application changes—a new item is added to inventory or the price of some goods change—the server can just call the client, which can then update its state of the application.

What do you think of DWR's RMI-like remote call mechanism for AJAX? And how do you synchronize state between client and server in a Web app?


maninder batth

Posts: 4
Nickname: anywhere
Registered: Mar, 2006

Re: Direct Web Remoting (DWR) 2.0 Reaches First Milestone Build Posted: Apr 19, 2006 6:28 AM
Reply to this message Reply
The biggest problem we faced when using dwr was during performance testing. Load runnner could not record the data going back and forth between web pages and server side code.
This manifested itself as failed transactions

Flat View: This topic has 1 reply on 1 page
Topic: Direct Web Remoting (DWR) 2.0 Reaches First Milestone Build Previous Topic   Next Topic Topic: MagicDraw UML Modeling Tool 11 Released

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use