HP Integrity NonStop J-Series User Manual

Page 104

Advertising
background image

"http://www.w3.org/TR/html4/loose.dtd">
<%@ include file="/WEB-INF/jsp/include.jsp"%>
<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"> Insert Operation Successfully Executed </h2>
<br>
${model.add}
<br>

<br>
<br>
<h4><a href=<c:url value="insert.htm"/>>Insert Employee</a></h4>
</body>
</html>

3.

Modify the insert.jsp file in the EmpInfo/WebContent/Web-INF/jsp/insert.jsp
directory to receive all the input data required to add a new employee record to the database,
by completing the following steps:
1.

Delete the following <c:out> tag from the <body> tag.

<h3 align="center"><c:out value="${now}"/></h3>

2.

Add the following lines of code in the body tag to receive all the inputs required to add
a new employee record.

<form:form method="post" commandName="emp">
<table width="95%" bgcolor="f8f8ff" border="0" cellspacing="0" cellpadding="5">
<tr>
<td align="left" width="20%">Employee Id :</td>
<td><form:input path="empid"/> </td>
</tr>
<tr>
<td align="left" width="20%">First Name :</td>
<td> <form:input path="firstname"/> </td>
</tr>
<tr>
<td align="left" width="20%">Last Name :</td>
<td> <form:input path="lastname"/> </td>
</tr>
<tr>
<td align="left" width="20%">Age :</td>
<td> <form:input path="age"/> </td>
</tr>
<tr>
<td align="left" width="20%">Email :</td>
<td> <form:input path="email"/> </td>
</tr>
</table>
<br>
<input type="submit" align="left" value="Insert">
</form:form>

After modification, the insert.jsp appears as:

<%@ 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">
<%@ include file="/WEB-INF/jsp/include.jsp" %>
<html>
<head>
<title> Spring Getting Started with EmpInfo Application </title>
</head>
<body>
<br>
<p><B><font color = "003399">Enter Employee Details</font></B></p>

<form:form method="post" commandName="emp">

<table width="95%" bgcolor="f8f8ff" border="0" cellspacing="0" cellpadding="5">
<tr>
<td align="left" width="20%">Employee Id :</td>
<td><form:input path="empid"/> </td>
</tr>
<tr>
<td align="left" width="20%">First Name :</td>

104 Getting Started with Spring

Advertising
This manual is related to the following products: