HP Integrity NonStop J-Series User Manual

Page 99

Advertising
background image

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 view with " + now);
return new ModelAndView("WEB-INF/jsp/insert.jsp", "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 explained in

“Decoupling

View from the Controller” (page 100)

.

NOTE:

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

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

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

Deploy the EmpInfo application using the steps specified in

“Deploying the EmpInfo WAR

File in NSJSP on NonStop” (page 131)

.

2.

Verify the EmpInfo application by accessing the URL:

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

The EmpInfo: Insert Employee screen appears.

Figure 26 EmpInfo: Insert Employee Screen

3.

Click Insert Employee.

The EmpInfo: Employee Details screen appears.

Overview of EmpInfo

99

Advertising
This manual is related to the following products: