HttpServletRequest.getRequestUri不能获取forward之前的uri解决
当调用?RequestDispatcher.forward(javax.servlet.ServletRequest, javax.servlet.ServletResponse)后,再调用javax.servlet.ServletRequest的getRequestUr方法得到的是forward后的uri,之前的uri得不到了。servlet规范明确规定了这种情况:getRequestURI
/** 57 * Standard Servlet 2.4+ spec request attributes for forward URI and paths. 58 * <p>If forwarded to via a RequestDispatcher, the current resource will see its 59 * own URI and paths. The originating URI and paths are exposed as request attributes. 60 */ 61 public static final String FORWARD_REQUEST_URI_ATTRIBUTE = "javax.servlet.forward.request_uri";
?
参照代码:
http://www.docjar.com/html/api/org/springframework/web/util/WebUtils.java.html
http://www.docjar.com/html/api/org/springframework/web/util/WebUtils.java.html
?
?