序号 | 方法 & 描述 |
---|
1 | Cookie[] getCookies()
返回客户端所有的Cookie的数组 |
2 | Enumeration getAttributeNames()
返回request对象的所有属性名称的集合 |
3 | Enumeration getHeaderNames()
返回所有HTTP头的名称集合 |
4 | Enumeration getParameterNames()
返回请求中所有参数的集合 |
5 | HttpSession getSession()
返回request对应的session对象,如果没有,则创建一个 |
6 | HttpSession getSession(boolean create)
返回request对应的session对象,如果没有并且参数create为true,则返回一个新的session对象 |
7 | Locale getLocale()
返回当前页的Locale对象,可以在response中设置 |
8 | Object getAttribute(String name)
返回名称为name的属性值,如果不存在则返回null。 |
9 | ServletInputStream getInputStream()
返回请求的输入流 |
10 | String getAuthType()
返回认证方案的名称,用来保护servlet,比如 "BASIC" 或者 "SSL" 或 null 如果 JSP没设置保护措施 |
11 | String getCharacterEncoding()
返回request的字符编码集名称 |
12 | String getContentType()
返回request主体的MIME类型,若未知则返回null |
13 | String getContextPath()
返回request URI中指明的上下文路径 |
14 | String getHeader(String name)
返回name指定的信息头 |
15 | String getMethod()
返回此request中的HTTP方法,比如 GET,,POST,或PUT |
16 | String getParameter(String name)
返回此request中name指定的参数,若不存在则返回null |
17 | String getPathInfo()
返回任何额外的与此request URL相关的路径 |
18 | String getProtocol()
返回此request所使用的协议名和版本 |
19 | String getQueryString()
返回此 request URL包含的查询字符串 |
20 | String getRemoteAddr()
返回客户端的IP地址 |
21 | String getRemoteHost()
返回客户端的完整名称 |
22 | String getRemoteUser()
返回客户端通过登录认证的用户,若用户未认证则返回null |
23 | String getRequestURI()
返回request的URI |
24 | String getRequestedSessionId()
返回request指定的session ID |
25 | String getServletPath()
返回所请求的servlet路径 |
26 | String[] getParameterValues(String name)
返回指定名称的参数的所有值,若不存在则返回null |
27 | boolean isSecure()
返回request是否使用了加密通道,比如HTTPS |
28 | int getContentLength()
返回request主体所包含的字节数,若未知的返回-1 |
29 | int getIntHeader(String name)
返回指定名称的request信息头的值 |
30 | int getServerPort()
返回服务器端口号 |