原始请求URI可以作为带有key的请求属性
RequestDispatcher.FORWARD_REQUEST_URI。
String originalRequestURI = request.getAttribute(RequestDispatcher.FORWARD_REQUEST_URI);if (originalRequestURI != null) { // It was forwarded. Now get the query string as follows. String originalQueryString = request.getAttribute(RequestDispatcher.FORWARD_QUERY_STRING);}注意:在较早的Servlet
API版本中,您需要对密钥进行硬编码。
String originalRequestURI = request.getAttribute("javax.servlet.forward.request_uri");// ...


