Creating a DWR Application
The AJAX registration form validation application will validate a user ID through a form for creating a user registration with a unique user ID. If the specified user ID isn't in the UserTable database table, the message "User ID is valid" displays, and a new user registration entry can be created. If the user ID is in the database already, the validation message "User ID is not Valid" displays.
- Select File-->New to create a JDeveloper application and project.
- Select General-->Application in the New Gallery window.
- Specify an application nameDWRApp, for exampleand click OK.
- Specify a project nameDWR, for exampleand click OK.
- Select File-->New to create a JavaServer Page (JSP).
- Select Web Tier-->JSP-->JSP in the New Gallery window, and click OK to start the Create JSP Wizard.
- Follow the wizard's steps to select "web application version servlet 2.4."
- Specify the file name, userregistration.jsp.
- Select the default Error Page Options, and select the default tag libraries, which are none.
- Select the default HTML Options.
You need to add a DWR configuration file, dwr.xml, to the WEB-INF directory. Select the WEB-INF folder in the Applications Navigator, and select File-->New. Select General-->XML-->XML Document in the New Gallery window, and click OK. Specify the file name as dwr.xml, and click OK to create the file. Create a directory named lib in the WEB-INF directory, and copy the dwr.jar file to it (see Figure 1).
Now configure a connection with the JBoss application server. Select the Connections tab, right-click the Application Server node, and select Create New Application Server Connection to start the Create Application Server Connection Wizard. Click Next; specify the connection name, JBossConnection; select Connection Type as JBoss 4.x, and click Next. In the JBoss Directory window specify the deploy directoryfor example, \Jboss\jboss-4.0.5.GA\server\default\deployand click Next. When you click Finish, a JBoss application server connection is created (see Figure 2).
|Figure 1. DWR Application Structure: The directory structure for the DWR application setup should look like this.|
|Figure 2. JBoss Connection: The Create Application Server Connection Wizard lets you establish a connection with the JBoss application server.|
<!ELEMENT allow ((create | convert)*)>