- 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 Summary
Modifier and TypeMethodDescriptionReturns the async context.getAttribute(String name)
Get the attribute.Returns the attribute names.Returns the character encoding.int
Get the content length.long
Get the content length.Returns the content type.Returns the dispatcher type.Get the input stream.Returns the local address.Returns the locale.Returns the locales.Returns the local name.int
Returns the local port.getParameter(String name)
Get the parameter.Returns the parameter map.Returns the parameter names.String[]
getParameterValues(String name)
Get the parameter values.Returns the protocol.Get the reader.getRealPath(String path)
Deprecated.Returns the remote address.Returns the remote host.int
Returns the remote port.getRequestDispatcher(String path)
Returns the request dispatcher.Returns the scheme.Returns the server name.int
Returns the server port.Returns the servlet context.boolean
Is async started.boolean
Is async supported.boolean
isSecure()
Is secure.void
removeAttribute(String name)
Remove the attribute.void
setAttribute(String name, Object object)
Set the attribute.void
setCharacterEncoding(String characterEncoding)
Set the character encoding.Start async processing.startAsync(ServletRequest servletRequest, ServletResponse servletResponse)
Start async processing.
-
Method Details
-
getAsyncContext
AsyncContext getAsyncContext()Returns the async context.- Returns:
- the async context
-
getAttribute
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
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
Get the parameter.- Parameters:
name
- the name.- Returns:
- the value or null if not found.
-
getParameterMap
Returns the parameter map.- Returns:
- the parameter map
-
getParameterNames
Enumeration<String> getParameterNames()Returns the parameter names.- Returns:
- the parameter names
-
getParameterValues
Get the parameter values.- Parameters:
name
- the name.- Returns:
- the values.
-
getProtocol
String getProtocol()Returns the protocol.- Returns:
- the protocol
-
getReader
Get the reader.- Returns:
- the reader.
- Throws:
IOException
- when an I/O error occurs.
-
getRealPath
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
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
Remove the attribute.- Parameters:
name
- the name.
-
setAttribute
Set the attribute.- Parameters:
name
- the name.object
- the object value.
-
setCharacterEncoding
Set the character encoding.- Parameters:
characterEncoding
- the character encoding.- Throws:
UnsupportedEncodingException
- when the encoding is NOT supported.
-
startAsync
Start async processing.- Returns:
- the async context.
- Throws:
IllegalStateException
- when not able to start async processing.
-
startAsync
AsyncContext startAsync(ServletRequest servletRequest, ServletResponse servletResponse) throws IllegalStateExceptionStart async processing.- Parameters:
servletRequest
- the servlet request.servletResponse
- the servlet response.- Returns:
- the async context.
- Throws:
IllegalStateException
- when not able to start async processing.
-