Package javax.servlet

Interface ServletRequest

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

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

    • getAsyncContext

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

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

      java.util.Enumeration<java.lang.String> getAttributeNames()
      Get the attribute names.
      Returns:
      the attribute names.
    • getCharacterEncoding

      java.lang.String getCharacterEncoding()
      Get 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

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

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

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

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

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

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

      java.util.Locale getLocale()
      Get the locale.
      Returns:
      the locale.
    • getLocales

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

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

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

      java.util.Enumeration<java.lang.String> getParameterNames()
      Get the parameter names.
      Returns:
      the parameter names.
    • getParameterValues

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

      java.lang.String getProtocol()
      Get the protocol.
      Returns:
      the protocol.
    • getReader

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

      java.lang.String getRealPath​(java.lang.String path)
      Deprecated.
      Get the real path.
      Parameters:
      path - the path.
      Returns:
      the real path.
    • getRemoteAddr

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

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

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

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

      java.lang.String getScheme()
      Get the scheme.
      Returns:
      the scheme.
    • getServerName

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

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

      ServletContext getServletContext()
      Get 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​(java.lang.String name)
      Remove the attribute.
      Parameters:
      name - the name.
    • setAttribute

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

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

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

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