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, then click
Next:
- Tomcat - Expand
Apache, and select
Apache Tomcat v7.0
- JBoss - Expand
JBoss Community, and select
JBoss 7.1 Runtime
- IBM - Select
WebSphere Application Server v8.5 or later
- Oracle - Select
Oracle WebLogic Server 12c or later
- In the
Home Directory (or
Tomcat installation directory) field, click
Browse and choose the location where you installed the servlet 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.
Open the Java EE perspective if prompted to 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. To do this:
- Right-click the
JSPBookDemo project in
Project Explorer, and click
Properties.
- Select
Java Build Path and click 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.
- Click
Apply.
- While you are still in the properties for JSPBookDemo, click
Deployment Assembly.
- Click
Add, then select
Project, and click
Next.
- On the next page select
CobolBook and click
Finish.
This adds an entry to the
Web Deployment Assembly list 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 project's properties dialog box. Once again, the project is built.
With these steps you created a dynamic Web project that incorporates your COBOL project.