Creating the view – HP Integrity NonStop J-Series User Manual

Page 94

Advertising
background image

logger.info("Returning hello view");
return new ModelAndView("insert.jsp");
}
}

Your basic controller implementation is ready. This controller is expanded further to add more
functionality to the EmpInfo application.

Creating the View

After completing the controller implementation for EmpInfo, complete the following steps to create
the first view of the EmpInfo application:
1.

Create a new JSP page insert.jsp in EmpInfo/WebContent by completing the steps
explained in

“Creating the index.jsp File” (page 80)

.

2.

Add <Spring Getting Started with EmpInfo Application> as the title tag,
<Welcome to the Enter Employee Details Page> as the header item and <Enter
Employee Details

> within the body tag of EmpInfo/WebContent/insert.jsp, as

shown below:

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Spring Getting Started with EmpInfo Application</title>
</head>
<body>
<h2 align="center"> Welcome to the EmpInfo Application </h2>
<br>
<p><B><font color = "003399">Enter Employee Details</font></B></p>
</body>
</html>

At this point, you can either deploy and verify the EmpInfo application you have developed
so far on the NonStop system, or you can proceed to the

“Developing and Configuring Views

and the Controller” (page 95)

section.

NOTE:

The code of the EmpInfo application developed so far is located in <My SASH

Home>\spring\getting-started\EmpInfo-InParts\Part-2

To verify the EmpInfo application, complete the following steps:

1.

Deploy the EmpInfo application using the steps described in

“Deploying EmpInfo on

NonStop” (page 129)

.

2.

Verify the EmpInfo application by accessing the following URL:

http://<IP Address of the iTP WebServer>:<port#>/<servlet
directory

>/EmpInfo/insert.htm

The Welcome screen of the EmpInfo application appears.

94

Getting Started with Spring

Advertising
This manual is related to the following products: