标签:spring family mvc framework style 配置 监听 att ring
方法一:
@Autowired
private HttpServletRequest request;
方法二:
public void test( HttpServletRequest request,HttpServletReponse reponse){
}
方法三:加入监听器
1,在web.xml 配置如下
<listener>
<listener-class>
org.springframework.web.context.request.RequestContextListener
</listener-class>
</listener>
2、在controller获取如下:
HttpServletRequest request = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest();
标签:spring family mvc framework style 配置 监听 att ring
原文地址:http://www.cnblogs.com/herohacker/p/7594599.html