HP Integrity NonStop J-Series User Manual

Page 101

Advertising
background image

return new ModelAndView("WEB-INF/jsp/insert.jsp", "now", now);

After modification:

return new ModelAndView("insert", "now", now);

After modification, the EmployeeController.java file appears as:

package com.hp.empinfo.web;

import org.springframework.web.servlet.mvc.SimpleFormController;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.io.IOException;
import java.util.Date;

public class EmployeeController extends SimpleFormController {

protected final Log logger = LogFactory.getLog(getClass());
public ModelAndView handleRequest(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
String now = (new Date()).toString();
logger.info("Returning hello view with " + now);
return new ModelAndView("insert", "now", now);
}
}

At this point, you can either deploy and verify the EmpInfo application you have developed
so far on the NonStop system, or you can continue with the steps described in

“Developing

Business Logic and Providing the Web Interface” (page 102)

.

NOTE:

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

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

To verify the EmpInfo application developed so far, complete the following steps:
1.

Deploy the EmpInfo application using the steps described in

“Deploying the EmpInfo

WAR File in NSJSP on NonStop” (page 131)

.

2.

Verify the EmpInfo application by accessing the following URL:

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

3.

Click Insert Employee.

The EmpInfo: Employee Details screen appears.

Overview of EmpInfo

101

Advertising
This manual is related to the following products: