Warning: Nothing links to this page
Aptana Jaxer and DWR Integration
Ease of Use
What's in it for DWR and Java users? You can see this as a way to cleanly separate a presentation layer written in Ajax (at both the client and the server) from a back-end business logic layer written in Java such that the Java layer is not directly exposed to the Internet.
Of course you can also use (Jaxer + DWR) and DWR in parallel to do the above, plus connect to DWR's reverse Ajax capabilities directly from the browser.
Much of the complexity of DWR configuration is to restrict what classes the Internet can access. When DWR is fronted by Jaxer, we don't need to expose DWR to the Internet. Effectively the client becomes trusted, so we can remove some of the configuration steps. There is for example no need for a dwr.xml file any more - The exported classes can be configured directly by the script. Clearly it's important that your DWR server is not accessible from the Internet and is properly fire-walled.
About the Downloads
There are 4 files available from the download area. 2 for use in an existing setup, and 2 as a demo to get started.
Files to add to an existing project:
- jaxer-dwr.jar: This is the jar file that users will put into their WEB-INF/lib directory on the Java server.
- web.xml: This is an example of the changes needed to WEB-INF/web.xml (also on the Java server).
If you are familiar with plain DWR, you don't need dwr.xml or any annotation configuration.
- demoServer.war: This is a simple demonstration web application that includes both of the files above and a trivial test client.
- demoRemoting.zip: Partner to demoServer.war for deploying to the Jaxer server. Unzip this archive into $JAXER_HOME/public.
If you want an easy way to see what DWR+Jaxer does, start by deploying this file to a Java server and by deploying demoRemoting.zip to a Jaxer server. See below for more detailed instructions.
How to get started with DWR+Jaxer
1. In your Aptana_Jaxer/public directory, create a directory called demoRemoting, then download and unzip demoRemoting.zip, into this directory.
You should now have 2 extra files:
(You shouldn't need this file, see troubleshooting note below)
2. Next, download demoServer.war and deploy it into your application server.
3. Start the application server and browse to http://localhost:8081/demoRemoting.
If you get an error message like this:
Then you are running against a version of Jaxer that does not contain the Jaxer/DWR integration. The preferred solution is to upgrade Jaxer, however if that fails you can also make a small edit to demoRemoting/index.html. See the comments in that file.
If your application server is not on the same machine, or is running on a different port, then you will need to edit Jaxer.dwr.pathToDwrServlet to point at the deployment of a web application containing jaxer-dwr.jar. See demoRemoting/index.html (around line 16) for more details.