假定请求的URL为 http://localhost:8080/news/addNews.do?type=1
java 代码
- request.getMethod();
-
- request.getServerName();
- request.getServerPort();
- request.getLocalAddr();
- request.getLocalName();
- request.getLocalPort();
-
- request.getRequestURL();
- request.getRequestURI();
- request.getContextPath();
- request.getServletPath();
- request.getQueryString();
-
- request.getProtocol();
- request.getScheme();
- request.getPathInfo();
- request.getPathTranslated();
- request.getAuthType();
-
- request.getRealPath();