springmvc controller层注解获取request和response

@Autowired
	protected HttpServletRequest request;

	@Autowired
	protected HttpServletResponse response;

	@Autowired
	protected HttpSession session;

	@Autowired
	protected ServletContext application;

之前试了spring.4.0.2不行,换成spring.4.1.1就可以了,看来是版本问题。

 Could not autowire field: private javax.servlet.http.HttpServletRequest


你可能感兴趣的:(springmvc controller层注解获取request和response)