This Blog has moved to http://www.falsepositives.com/

False Positives Adventures in Technology, SciFi and Culture from Toronto

Friday, December 10, 2004

DWR: DWR (Direct Web Remoting), Allows JavaScript to call server-side Java

dwr: DWR (Direct Web Remoting) is a very simple way to call Java code directly from within browser JavaScript. It helps you create sites like G-Mail, Google Suggest or Kuro5hin that update themselves without loading new pages.

It comes as a simple jar file and a few lines to add to your web.xml file to configure the remoted classes. In a web page you add a couple of script tags to indicate which classes you wish to import and can then call your Java code directly from Javascript. More detailed instructions are available on the DWR site.
How it works

The Javascript works by dynamically creating an iframe through which it calls the DWR servlet with instructions about what Java code to call. The DWR servlet marshalls the parameters, calls the server-side Java code and returns the reply to the iframe, which triggers an onload, which returns the reply to the calling Javascript.

Category : JavaScript


Please Note that this Blog (False Positives) has moved to http://www.falsepositives.com/

0 Comments:

Post a Comment

<< Home