public class ServletRequestContext extends Object implements UploadContext
Provides access to the request information needed for a request made to an HTTP servlet.
| Constructor and Description |
|---|
ServletRequestContext(HttpServletRequest request)
Construct a context for this request.
|
| Modifier and Type | Method and Description |
|---|---|
long |
contentLength()
Retrieve the content length of the request.
|
String |
getCharacterEncoding()
Retrieve the character encoding for the request.
|
int |
getContentLength()
Deprecated.
1.3 Use
contentLength() instead |
String |
getContentType()
Retrieve the content type of the request.
|
InputStream |
getInputStream()
Retrieve the input stream for the request.
|
String |
toString()
Returns a string representation of this object.
|
public ServletRequestContext(HttpServletRequest request)
request - The request to which this context applies.public String getCharacterEncoding()
getCharacterEncoding in interface RequestContextpublic String getContentType()
getContentType in interface RequestContext@Deprecated public int getContentLength()
contentLength() insteadgetContentLength in interface RequestContextpublic long contentLength()
contentLength in interface UploadContextpublic InputStream getInputStream() throws IOException
getInputStream in interface RequestContextIOException - if a problem occurs.Copyright © 2002–2019 The Apache Software Foundation. All rights reserved.