Interface ServletRequest

All Known Subinterfaces:
HttpServletRequest, WebApplicationRequest
All Known Implementing Classes:
AsyncHttpDispatchWrapper, AsyncNonHttpDispatchWrapper, DefaultWebApplicationRequest, EmbeddedRequest, HttpServletRequestWrapper, HttpWebApplicationRequest, NanoRequest, RealtimeHttpServletRequestWrapper, ServletRequestWrapper, WeldHttpServletRequest

public interface ServletRequest
The ServletRequest API.
Author:
Manfred Riem ([email protected])
  • Method Details

    • getAsyncContext

      AsyncContext getAsyncContext()
      Returns the async context.
      Returns:
      the async context
    • getAttribute

      Object getAttribute(String name)
      Get the attribute.
      Parameters:
      name - the name.
      Returns:
      the value, or null if not found.
    • getAttributeNames

      Enumeration<String> getAttributeNames()
      Returns the attribute names.
      Returns:
      the attribute names
    • getCharacterEncoding

      String getCharacterEncoding()
      Returns the character encoding.
      Returns:
      the character encoding
    • getContentLength

      int getContentLength()
      Get the content length.
      Returns:
      the content length, or -1 if not known.
    • getContentLengthLong

      long getContentLengthLong()
      Get the content length.
      Returns:
      the content length, or -1 if not known.
    • getContentType

      String getContentType()
      Returns the content type.
      Returns:
      the content type
    • getDispatcherType

      DispatcherType getDispatcherType()
      Returns the dispatcher type.
      Returns:
      the dispatcher type
    • getInputStream

      ServletInputStream getInputStream() throws IOException
      Get the input stream.
      Returns:
      the input stream.
      Throws:
      IOException - when an I/O error occurs.
    • getLocalAddr

      String getLocalAddr()
      Returns the local address.
      Returns:
      the local address
    • getLocalName

      String getLocalName()
      Returns the local name.
      Returns:
      the local name
    • getLocalPort

      int getLocalPort()
      Returns the local port.
      Returns:
      the local port
    • getLocale

      Locale getLocale()
      Returns the locale.
      Returns:
      the locale
    • getLocales

      Enumeration<Locale> getLocales()
      Returns the locales.
      Returns:
      the locales
    • getParameter

      String getParameter(String name)
      Get the parameter.
      Parameters:
      name - the name.
      Returns:
      the value or null if not found.
    • getParameterMap

      Map<String,​String[]> getParameterMap()
      Returns the parameter map.
      Returns:
      the parameter map
    • getParameterNames

      Enumeration<String> getParameterNames()
      Returns the parameter names.
      Returns:
      the parameter names
    • getParameterValues

      String[] getParameterValues(String name)
      Get the parameter values.
      Parameters:
      name - the name.
      Returns:
      the values.
    • getProtocol

      String getProtocol()
      Returns the protocol.
      Returns:
      the protocol
    • getReader

      BufferedReader getReader() throws IOException
      Get the reader.
      Returns:
      the reader.
      Throws:
      IOException - when an I/O error occurs.
    • getRealPath

      @Deprecated String getRealPath(String path)
      Deprecated.
      Returns the real path.
      Parameters:
      path - the path.
      Returns:
      the real path
    • getRemoteAddr

      String getRemoteAddr()
      Returns the remote address.
      Returns:
      the remote address
    • getRemoteHost

      String getRemoteHost()
      Returns the remote host.
      Returns:
      the remote host
    • getRemotePort

      int getRemotePort()
      Returns the remote port.
      Returns:
      the remote port
    • getRequestDispatcher

      RequestDispatcher getRequestDispatcher(String path)
      Returns the request dispatcher.
      Parameters:
      path - the path.
      Returns:
      the request dispatcher
    • getScheme

      String getScheme()
      Returns the scheme.
      Returns:
      the scheme
    • getServerName

      String getServerName()
      Returns the server name.
      Returns:
      the server name
    • getServerPort

      int getServerPort()
      Returns the server port.
      Returns:
      the server port
    • getServletContext

      ServletContext getServletContext()
      Returns the servlet context.
      Returns:
      the servlet context
    • isAsyncStarted

      boolean isAsyncStarted()
      Is async started.
      Returns:
      true if it is, false otherwise.
    • isAsyncSupported

      boolean isAsyncSupported()
      Is async supported.
      Returns:
      true if it is, false otherwise.
    • isSecure

      boolean isSecure()
      Is secure.
      Returns:
      true if it is, false otherwise.
    • removeAttribute

      void removeAttribute(String name)
      Remove the attribute.
      Parameters:
      name - the name.
    • setAttribute

      void setAttribute(String name, Object object)
      Set the attribute.
      Parameters:
      name - the name.
      object - the object value.
    • setCharacterEncoding

      void setCharacterEncoding(String characterEncoding) throws UnsupportedEncodingException
      Set the character encoding.
      Parameters:
      characterEncoding - the character encoding.
      Throws:
      UnsupportedEncodingException - when the encoding is NOT supported.
    • startAsync

      AsyncContext startAsync() throws IllegalStateException
      Start async processing.
      Returns:
      the async context.
      Throws:
      IllegalStateException - when not able to start async processing.
    • startAsync

      AsyncContext startAsync(ServletRequest servletRequest, ServletResponse servletResponse) throws IllegalStateException
      Start async processing.
      Parameters:
      servletRequest - the servlet request.
      servletResponse - the servlet response.
      Returns:
      the async context.
      Throws:
      IllegalStateException - when not able to start async processing.