Setup
- Install Tomcat
and start it
- Start JDeveloper
- Create a new Empty Project called emp
- Double-click the emp project and select Libraries - add
the Servlet Runtime and the Oracle JDBC libraries
- Right-click the emp project and select New
- Select Deployment Profiles from the General section in the left pane
- Select WAR File from the right pane
- Click OK
- As Deployment Profile Name, enter emp
- Click OK
- As Web Application's Context Root, select Specify J2EE Web Context Root
and enter emp
- Under File Groups > WEB-INF/lib > Contributors, select Oracle JDBC
- Click OK
Developing the application
- Right-click the emp project and select New
- Select Servlets from the Web Tier section in the left pane
- Select HTTP Servlet from the right pane
- Click OK
- Click Next
- Step 1:
- as Class, enter EmpList
- as Package, remove the suggested emp
- Click Next
- Step 2:
- as Name, enter EmpList (already entered)
- as URL Pattern, enter /EmpList (not /emplist as suggested)
- Click Finish
- Enter the source code for the EmpList servlet
(click the name of the servlet to see source code)
- Repeat the above steps for the EmpEdit and
EmpUpd servlets
(click the names of the servlets to see source code)
- Compile the servlets (press Ctrl+F9)
- Right-click on the emp.deploy file and select Deploy to WAR file
Deploying the application
- Go to Tomcat Manager
- Scroll down to the WAR file to deploy section
- Click Browse and navigate to the emp.war file (e.g. D:\data\jdev10133\emp\deploy\emp.war)
- Click Deploy
Invoking the application
- Go to http://localhost:8080/emp/EmpList