由于sringmvc脱离了HttpServletRequest作为参数,不能够直接使用request,所以得在web.xml里配置RequestContextListener监听访问request:
HttpServletRequst requst = ((ServletRequestAttributes)RequestContextHolder.getRequetAttribute()).getRequest();
由于sringmvc脱离了HttpServletRequest作为参数,不能够直接使用request,所以得在web.xml里配置RequestContextListener监听访问request:
HttpServletRequst requst = ((ServletRequestAttributes)RequestContextHolder.getRequetAttribute()).getRequest();