Create a new project
As you will be using features such as servlets and JSP files in this tutorial, you need to create a
dynamic web project to contain these resources. This is in contrast to a
static web project that does not contain any dynamic content.
- Click
File > New > Other.
- Expand the Web node and select
Dynamic Web Project. Click
Next.
- Enter
JSPBookDemo in the
Project name field.
- Ensure
Use default location is selected.
- In the
Target runtime field, either select an already existing servlet container runtime, or, if you have
<None> showing, set one up as follows:
- Click
New Runtime.
- You now need to choose the runtime of the Java servlet that you installed previously:
- Apache - Select Apache Tomcat v7.0 or later
- JBoss - Expand JBoss Community, and select JBoss 6.x Runtime
- IBM - Select WebSphere Application Server v8.5 or later
- Oracle - Select Oracle WebLogic Server 12c or later
and click
Next.
- Choose the location where you installed the servlet by clicking
Browse for Apache Tomcat, JBoss or IBM WebSphere, or enter the installation path for Oracle WebLogic.
- For Apache Tomcat or IBM WebSphere select an appropriate JRE (usually the same one as the project). Click
Finish.
- Set the Dynamic web module version to 2.5.
- Click
Finish.
This may ask you to open the Java EE perspective. Do so. All commands involving JSPBookDemo will be expected in the Java EE perspective.
Add appropriate references to the JVM COBOL project
You need to add a reference to the COBOL project in both the build options, so that the Java compiler can find the appropriate classes to build against, and in the deployment assembly, so that the JVM COBOL program will be exported into the created Web archive.
- Right-click on the JSPBookDemo project, and click
Properties to open the project properties dialog.
- Select Java Build Path and the Projects tab.
- Click
Add, check the CobolBook project and click
OK.
- Open the Libraries tab.
- Click
Add Library, select
COBOL JVM Runtime System, click
Next, and finally click
Finish.
- While you are still in the Properties for JSPBookDemo, select the
Deployment Assembly option. In response to
Setting Java Build Path click
Apply.
- Click
Add, then select
Project, and click
Next.
- On the next page select
CobolBook and click
Finish. This adds an entry to the deployment assembly dialog box, to indicate that the CobolBook project classes will be included in the
WEB-INF/lib directory of the Web archive. The project is also built.
- Click
Add, then select
Java Build Path Entries, and click
Next.
- On the next page select
COBOL JVM Runtime System and click
Finish.
- Click
OK to exit the Properties dialog box. Once again, the project is built.
This exercise completes the creation of the dynamic web project with the incorporation of the COBOL project.