Package javax.servlet
Interface ServletRequest
-
- All Known Subinterfaces:
HttpServletRequest
,WebApplicationRequest
,WebApplicationServerRequest
- All Known Implementing Classes:
DefaultWebApplicationRequest
,DefaultWebApplicationServerRequest
,EmbeddedRequest
,HttpServletRequestWrapper
,NanoRequest
,RealtimeHttpServletRequestWrapper
,ServletRequestWrapper
,WeldHttpServletRequest
public interface ServletRequest
The ServletRequest API.- Author:
- Manfred Riem ([email protected])
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description AsyncContext
getAsyncContext()
Get the async context.Object
getAttribute(String name)
Get the attribute.Enumeration<String>
getAttributeNames()
Get the attribute names.String
getCharacterEncoding()
Get the character encoding.int
getContentLength()
Get the content length.long
getContentLengthLong()
Get the content length.String
getContentType()
Get the content type.DispatcherType
getDispatcherType()
Get the dispatcher type.ServletInputStream
getInputStream()
Get the input stream.String
getLocalAddr()
Get the local address.Locale
getLocale()
Get the locale.Enumeration<Locale>
getLocales()
Get the locales.String
getLocalName()
Get the local name.int
getLocalPort()
Get the local port.String
getParameter(String name)
Get the parameter.Map<String,String[]>
getParameterMap()
Get the parameter map.Enumeration<String>
getParameterNames()
Get the parameter names.String[]
getParameterValues(String name)
Get the parameter values.String
getProtocol()
Get the protocol.BufferedReader
getReader()
Get the reader.String
getRealPath(String path)
Deprecated.String
getRemoteAddr()
Get the remote address.String
getRemoteHost()
Get the remote host.int
getRemotePort()
Get the remote port.RequestDispatcher
getRequestDispatcher(String path)
Get the request dispatcher.String
getScheme()
Get the scheme.String
getServerName()
Get the server name.int
getServerPort()
Get the server port.ServletContext
getServletContext()
Get the servlet context.boolean
isAsyncStarted()
Is async started.boolean
isAsyncSupported()
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.AsyncContext
startAsync()
Start async processing.AsyncContext
startAsync(ServletRequest servletRequest, ServletResponse servletResponse)
Start async processing.
-
-
-
Method Detail
-
getAsyncContext
AsyncContext getAsyncContext()
Get 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()
Get the attribute names.- Returns:
- the attribute names.
-
getCharacterEncoding
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
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 IOException
Get the input stream.- Returns:
- the input stream.
- Throws:
IOException
- when an I/O error occurs.
-
getLocalAddr
String getLocalAddr()
Get the local address.- Returns:
- the local address.
-
getLocalName
String getLocalName()
Get the local name.- Returns:
- the local name.
-
getLocalPort
int getLocalPort()
Get the local port.- Returns:
- the local port.
-
getLocale
Locale getLocale()
Get the locale.- Returns:
- the locale.
-
getLocales
Enumeration<Locale> getLocales()
Get 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()
Get the parameter map.- Returns:
- the parameter map.
-
getParameterNames
Enumeration<String> getParameterNames()
Get 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()
Get 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
String getRealPath(String path)
Deprecated.Get the real path.- Parameters:
path
- the path.- Returns:
- the real path.
-
getRemoteAddr
String getRemoteAddr()
Get the remote address.- Returns:
- the remote address.
-
getRemoteHost
String getRemoteHost()
Get the remote host.- Returns:
- the remote host.
-
getRemotePort
int getRemotePort()
Get the remote port.- Returns:
- the remote port.
-
getRequestDispatcher
RequestDispatcher getRequestDispatcher(String path)
Get the request dispatcher.- Parameters:
path
- the path.- Returns:
- the request dispatcher.
-
getScheme
String getScheme()
Get the scheme.- Returns:
- the scheme.
-
getServerName
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(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.
-
-