在控制器中使用原生的ServletAPI对象
只需要在控制器的方法参数定义HttpServletRequest和HttpServletResponse对象
@RequestMapping(path = "/testServlet",method = RequestMethod.GET)
public String testServlet(HttpServletRequest request, HttpServletResponse response){
System.out.println("testServlet。。。。");
System.out.println("request "+request);
HttpSession session = request.getSession();
System.out.println("session "+session);
System.out.println("response "+response);
return "success";
}