beautypg.com

Modifying the index.jsp file, Modifying the insert.jsp file – HP Integrity NonStop J-Series User Manual

Page 59

background image

2.

Add the tag extensions (taglibs) to include the.jsp file so that the include.jsp file appears
as:

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
"http://www.w3.org/TR/html4/loose.dtd">
<%@ page session="false"%>

<%@ taglib prefix="c"
uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt"
uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="form"
uri="http://www.springframework.org/tags/form" %>

NOTE:

The created header file must be included in every JSP page. This ensures that the

same definitions are included in all JSPs. You must add all the JSPs in a subdirectory named
jsp

in the WEB-INF directory. This allows views to be accessible via the controller because

these pages cannot be accessed via a URL.

Modifying the index.jsp File

1.

Include the include.jsp file:

<%@ include file="/WEB-INF/jsp/include.jsp" %>

2.

Provide a link to the insert.jsp page as follows:

>Insert Employee

3.

Delete the following line from the tag.

This is EmpInfo Test Page.

After modification, the index.jsp file appears as:

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
"http://www.w3.org/TR/html4/loose.dtd">
<%@ include file="/WEB-INF/jsp/include.jsp" %>



Spring Getting Started with EmpInfo Application


Welcome to the EmpInfo Application




>Insert Employee





Modifying the insert.jsp File

1.

Move the insert.jsp file to the EmpInfo/WebContent/WEB-INF/jsp directory by
dragging and dropping the file on the Eclipse window.

2.

Include the include.jsp file in insert.jsp:

<%@ include file="/WEB-INF/jsp/include.jsp" %>

3.

Add the tag to display the current date and time retrieved from the model passed
to the view, which will be rendered using the JSTL.

For example:

After modification, the insert.jsp file appears as:

Getting Started with Spring

59

This manual is related to the following products: