ServletRequest接口:
使用ServletRequest接口创建对象,用于使客户端请求信息对Servlet可用,创建的对象作为参数传递之Servlet的Service() ServletRequest接口的方法: getAttribute(String) getAttributeNames() getCharacterEncoding() setCharacterEncoding(String) getContentLength() getContentType() getInputStream() getParameter(String) getParameterNames() getParameterValues(String) getParameterMap() getProtocol() getScheme() getServerName() getServerPort() getReader() getRemoteAddr() getRemoteHost() setAttribute(String, Object) removeAttribute(String) getLocale() getLocales() isSecure() getRequestDispatcher(String) getRealPath(String) getRemotePort() getLocalName() getLocalAddr() getLocalPort() getServletContext() startAsync() startAsync(ServletRequest, ServletResponse) isAsyncStarted() isAsyncSupported() getAsyncContext() getDispatcherType()ServletResponse接口:
使用ServletResponse接口创建的对象用于向客户端提供响应,创建的对象作为参数传递至Servlet的service()方法,该接口中
方法如下: getCharacterEncoding() getContentType() getOutputStream() getWriter() setCharacterEncoding(String) setContentLength(int) setContentType(String) setBufferSize(int) getBufferSize() flushBuffer() resetBuffer() isCommitted() reset() setLocale(Locale) getLocale()