beautypg.com

HP Integrity NonStop H-Series User Manual

Page 114

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 your NonStop system, or you can continue with the steps explained in the

Decoupling View from the Controller

section.

NOTE:

The code of the EmpInfo application developed so far is present in

<My SASH

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

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

1.

Deploy the application using the steps specified in the

Deploying the EmpInfo WAR

File in NSJSP on NonStop

section.

2.

Verify your application by accessing the URL:

http://:/servlet_jsp/EmpInfo

The EmpInfo: Insert Employee screen appears.

Figure 5-20

shows the EmpInfo: Insert Employee screen.

114

Getting Started with Spring

This manual is related to the following products: