Intergrate DWR into Your Java Web Application
(Page 1 of 4 )
If you want to build your Ajax application around a JavaScript framework, you will need to use Direct Web Remoting code. This article shows you how. It is excerpted from Hack 43 from the book
Ajax Hacks, written by Bruce W. Perry (O'Reilly; ISBN: 0596101694). Copyright © 2007 O'Reilly Media, Inc. All rights reserved. Used with permission from the publisher. Available from booksellers or direct from O'Reilly Media.
HACK 43 Design your Ajax application around a JavaScript framework bound to Java objects on the server.
The Direct Web Remoting code comes in the form of an archived or zipped Java Archive (JAR) file, dwr.jar. The download address is http://www. getahead.ltd.uk/dwr/download.html.
The top-level web page for this open source software is http://www.getahead.ltd.uk/dwr/. Check out the license details for more information while you are visiting this page.
To get started with DWR, you must first set it up in your server-side web application. Place the dwr.jar file in the /WEB-INF/lib directory of your Java web application on the server, then restart or reload the application.
For those not familiar with Java web applications, they all have a top-level directory named WEB-INF. Inside WEB-INF are XML configuration files, the main one being web.xml. WEB-INF also contains a directory named lib, which encloses code libraries or JAR files that the application depends on, such as database drivers and helper classes. The dwr.jar file goes in this lib directory.
Next: Configuring the Application >>
More JavaScript Articles
More By O'Reilly Media
|
This article is excerpted from Hack 42 of the book Ajax Hacks, written by Bruce W. Perry (O'Reilly; ISBN: 0596101694). Check it out today at your favorite bookstore. Buy this book now.
|
|