一、MVC 的Handler 方法可以接受一下ServletAPI 类型的参数
- HttpServletRequest
- HttpServletResponse
- HttpSession
- java.security.Principal
- Locale
- InputStream
- OutputStream
- Reader Writer
二、示例代码
@RequestMapping("/TestServletAPI")
public void TestServletAPI(HttpServletRequest req, HttpServletResponse res, Writer out) throws IOException {
System.out.println("HttpServletRequest = " + req
+ " HttpServletResponse = " + res);
out.write("hello springmvc !");
//return SUCCESS;
}