Download the DWR 1.1.4 JAR file, dwr.jar. Most browsers support DWR, and the application example described here will employ Microsoft Internet Explorer 6. DWR requires the Java Developer Kit (JDK) 1.3 or later and a servlet container that supports servlet specification 2.2 or later. Install a JDK if one is not installed already. JDK 1.5.0_10 was used for the application example discussed here.
DWR has been tested on these web servers: Tomcat, WebLogic, WebSphere, JBoss, Jetty, Resin, Sun ONE, and Glassfish. For this application use JBoss 4.05. Install JBoss 4.x, if it's not installed already. This DWR application will also use the MySQL database; installing MySQL 5.0 is therefore recommended. Create a database table named UserTable in the MySQL database using this script:
CREATE TABLE UserTable(userid VARCHAR(25)
PRIMARY KEY, password VARCHAR(25));
INSERT INTO UserTable VALUES('dvohra', 'ajaxdwr');
INSERT INTO UserTable VALUES('jsmith', 'smith');
Configure JBoss with MySQL by copying the mysql-ds.xml
file from the \JBoss\jboss-4.0.5.GA\docs\examples\jca
directory to the \JBoss\jboss-4.0.5.GA\server\default\deploy
directory. The MySQL datasource is specified as MySqlDS
in the mysql-ds.xml
file. Specify the connection URL and driver class:
A password is not required for the root user. Specify the user-name and password this way:
Download the MySQL JDBC driver JAR file, mysql-connector-java-5.0.4-bin.jar
, and copy it to the \jboss-4.0.5.GA\server\default\lib
directory. For this discussion the DWR web application example was developed in the JDeveloper IDE. You can download the JDeveloper 10.1.3.2 ZIP file, and extract it to a separate directory to install it.