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
Red Hat JBoss Middleware, and select
Red Hat JBoss Enterprise Application Platform 7.1 Runtime.
- IBM - Select
WebSphere Application Server v8.5 or later.
- Oracle - Select
Oracle WebLogic Server 12.1.1 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:
- In the Project Explorer, right-click the
JSPBookDemo project, and then click
Properties.
- Click
Java Build Path, and then click the
Projects tab.
- In the
Required projects on the build path list, click
Classpath.
- Click
Add.
This opens the
Required Project Selection dialog box.
- Check the
CobolBook project, and then click
OK.
- Click the
Libraries tab.
- In the
JARs and class folders on the build path list, click
Classpath.
- Click
Add Library.
This opens the
Add Library dialog box.
- Click
COBOL JVM Runtime System, and then click
Next
- 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 click
CobolBook, and then click
Finish.
This adds an entry to the
Web Deployment Assembly list to indicate that the CobolBook project classes are 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 then click
Next.
- On the next page, select
COBOL JVM Runtime System, and then click
Finish.
- Click
Apply and Close 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.