request中的get方法
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
Object attribute = request.getAttribute("");//获得setAttribute的数据
Enumeration<String> names = request.getAttributeNames();//返回所有属性名的枚举
String authType = request.getAuthType();//返回用于保护servlet的验证方法名称
String encoding = request.getCharacterEncoding();//返回字符编码方式
Class<? extends HttpServletRequest> aClass = request.getClass();//返回一个类
int contentLength = request.getContentLength();//返回请求体的长度,以字节数返回请求体的长度
String contentType = request.getContentType();//得到请求体的mime类型
String contextPath = request.getContextPath();//获取当前系统的路径,获得应用名称
Cookie[] cookies = request.getCookies();//返回此次请求发送的cookie对象
long dateHeader = request.getDateHeader("");//用于将指定头信息的部分转换成方便为转换时间类型的长整数型。
String header = request.getHeader("");//获取客户端的浏览器类型
Enumeration<String> headerNames = request.getHeaderNames();//返回请求头包含的所有头名称的枚举,
Enumeration<String> headers = request.getHeaders("");//获取一个name的多个值序列,返回请求给出的指定类型的所有HTTP头标的名称的枚举值
ServletInputStream inputStream = request.getInputStream();//得到请求体中一行二进制流
int intHeader = request.getIntHeader("");//以int 的值返回指定请求头的值
String ip = request.getLocalAddr();//接受请求的接口的 InternetProtocol (IP) 地址
Locale locale = request.getLocale();//基于 Accept-Language 头,返回客户端将用来接受内容的首选 Locale(场所或地点) 客户端语言环境
Enumeration<Locale> locales = request.getLocales();//所有的语言环境
String IpName = request.getLocalName();//接收请求的 Internet Protocol(IP) 接口的主机名
int localPort = request.getLocalPort();//接收请求的接口的 InternetProtocol (IP) 端口号
String method = request.getMethod();//请求方式
String parameter = request.getParameter("");//获得表单提交的数据
Map<String, String[]> parameterMap = request.getParameterMap();//返回的类型是一个数组
Enumeration<String> parameterNames = request.getParameterNames();//将发送请求页面中form表单里所有具有name属性的表单对象获取(包括button).返回一个Enumeration类型的枚举
String[] parameterValues = request.getParameterValues("");//将获取所有form表单中name属性为"name"的值.该方法返回一个数组.遍历数组就可得到value值
String pathInfo = request.getPathInfo();//返回与客户端发出此请求时发送的URL相关联的额外路径信息。
String pathTranslated = request.getPathTranslated();//映射到服务器实际路径之后的路径信息。
String protocol = request.getProtocol();//返回请求用的协议类型及版本号获取客户端向服务器端传送数据所依据的协议名称。
String queryString = request.getQueryString();//字符串形式的附加到URL后面的查询字符串,数据仍旧是URL编码的
BufferedReader reader = request.getReader();//返回解码过了的请求体
String realPath = request.getRealPath("");//返回一虚拟路径的真实路径
String remoteAddr = request.getRemoteAddr();//返回发送此请求的客户端IP地址
String remoteHost = request.getRemoteHost();//返回发送此请求的客户端主机名 获取客户端的名字
int remotePort = request.getRemotePort();//发送请求的客户主机端口
String remoteUser = request.getRemoteUser();//返回包含在请求RUL中路径后面的查询字符串。如果没有查询字符串返回null
RequestDispatcher requestDispatcher = request.getRequestDispatcher("");//请求转发,获取请求过来的地址,与该地址共享一个Request
String requestedSessionId = request.getRequestedSessionId();//返回客户端制定的回话ID
String requestURI = request.getRequestURI();//请求的资源
StringBuffer requestURL = request.getRequestURL();//获取URL,包含域名,不包含请求内容
String scheme = request.getScheme();// 返回请求用的计划名, 返回当前链接使用的协议 如:http.https及ftp等
String serverName = request.getServerName();//返回接受请求的服务器主机名获取服务器的名字。
int serverPort = request.getServerPort();//返回服务器接受此请求所用的端口号
String servletPath = request.getServletPath();//返回请求调用servlet的URL部分
HttpSession session = request.getSession();//返回与此请求关联的当前HttpSession,如果没有当前会话并且参数为true,则返回一个新会话
Principal userPrincipal = request.getUserPrincipal();// 返回包含当前已经过验证的用户的名称的java.security.Principal对象。如果用户没有经过验证,则该方法返回null
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
this.doPost(request,response);
}