HttpServletRequest request = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest();
当然一般我们也可从controller中通过方法的参数传递获取到HttpServletRequest.上述方法只是避免了参数传递而已。
转载于:https://www.cnblogs.com/roy-blog/p/7459021.html
HttpServletRequest request = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest();
当然一般我们也可从controller中通过方法的参数传递获取到HttpServletRequest.上述方法只是避免了参数传递而已。
转载于:https://www.cnblogs.com/roy-blog/p/7459021.html