Servlet(5)—ServletRequest接口和ServletResponse接口

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()

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值