HP Integrity NonStop H-Series User Manual
Page 114
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
section.
2.
Verify your application by accessing the URL:
The EmpInfo: Insert Employee screen appears.
shows the EmpInfo: Insert Employee screen.
114
Getting Started with Spring