zoukankan      html  css  js  c++  java
  • 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()

  • 相关阅读:
    C++结构体中sizeof
    sizeof()的用法
    XStream和Json
    省市联动
    ajax
    配置文件的读取
    JSP标签库
    字符串函数参数传入传出(去空格)
    字符串函数参数传入传出(字符串反转)
    opendir,readdir,closedir
  • 原文地址:https://www.cnblogs.com/tengpengfei/p/10453990.html
Copyright © 2011-2022 走看看