|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.ServletRequestWrapper
javax.servlet.http.HttpServletRequestWrapper
org.apache.sling.engine.impl.SlingHttpServletRequestImpl
public class SlingHttpServletRequestImpl
The SlingHttpServletRequestImpl
TODO
Constructor Summary | |
---|---|
SlingHttpServletRequestImpl(RequestData requestData,
javax.servlet.http.HttpServletRequest servletRequest)
|
Method Summary | ||
---|---|---|
|
adaptTo(Class<AdapterType> type)
Adapts the adaptable to another type. |
|
javax.servlet.http.Cookie |
getCookie(String name)
Returns the named cookie from the HTTP request or null if
no such cookie exists in the request. |
|
javax.servlet.ServletInputStream |
getInputStream()
|
|
String |
getParameter(String name)
|
|
Map<String,String[]> |
getParameterMap()
|
|
Enumeration<String> |
getParameterNames()
|
|
String[] |
getParameterValues(String name)
|
|
String |
getPathInfo()
Returns the part of the request URL without the leading servlet context path. |
|
BufferedReader |
getReader()
|
|
RequestData |
getRequestData()
|
|
javax.servlet.RequestDispatcher |
getRequestDispatcher(Resource resource)
Returns null if resource is null . |
|
javax.servlet.RequestDispatcher |
getRequestDispatcher(Resource resource,
RequestDispatcherOptions options)
Returns null if resource is null . |
|
javax.servlet.RequestDispatcher |
getRequestDispatcher(String path)
Returns null if path is null . |
|
javax.servlet.RequestDispatcher |
getRequestDispatcher(String path,
RequestDispatcherOptions options)
Returns null if path is null . |
|
RequestParameter |
getRequestParameter(String name)
Returns the value of a request parameter as a RequestParameter ,
or null if the parameter does not exist. |
|
RequestParameterMap |
getRequestParameterMap()
Returns a Map of the parameters of this request. |
|
RequestParameter[] |
getRequestParameters(String name)
Returns an array of RequestParameter objects containing all of
the values the given request parameter has, or null if the
parameter does not exist. |
|
RequestPathInfo |
getRequestPathInfo()
Returns the RequestPathInfo pertaining to this request. |
|
RequestProgressTracker |
getRequestProgressTracker()
Returns the RequestProgressTracker of this request. |
|
Resource |
getResource()
Returns the Resource object on whose behalf the servlet acts. |
|
ResourceBundle |
getResourceBundle(Locale locale)
Returns the resource bundle for the given locale. |
|
ResourceBundle |
getResourceBundle(String baseName,
Locale locale)
Returns the resource bundle of the given base name for the given locale. |
|
ResourceResolver |
getResourceResolver()
Returns the ResourceResolver which resolved the
resource of this request. |
|
String |
getResponseContentType()
Returns the framework preferred content type for the response. |
|
Enumeration<String> |
getResponseContentTypes()
Gets a list of content types which the framework accepts for the response. |
|
String |
getServletPath()
Always returns the empty string since the actual servlet registered with the servlet container (the HttpService actually) is registered as if the servlet path is "/*". |
|
Principal |
getUserPrincipal()
|
|
boolean |
isUserInRole(String role)
|
Methods inherited from class javax.servlet.http.HttpServletRequestWrapper |
---|
getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getSession, getSession, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid |
Methods inherited from class javax.servlet.ServletRequestWrapper |
---|
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getProtocol, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding, setRequest |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.servlet.http.HttpServletRequest |
---|
getAuthType, getCookies, getDateHeader, getHeader, getHeaderNames, getIntHeader, getMethod, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getSession, getSession, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid |
Methods inherited from interface javax.servlet.ServletRequest |
---|
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getProtocol, getRealPath, getRemoteAddr, getRemoteHost, getScheme, getServerName, getServerPort, setAttribute |
Constructor Detail |
---|
public SlingHttpServletRequestImpl(RequestData requestData, javax.servlet.http.HttpServletRequest servletRequest)
Method Detail |
---|
public final RequestData getRequestData()
public <AdapterType> AdapterType adaptTo(Class<AdapterType> type)
Adaptable
adaptTo
in interface Adaptable
AdapterType
- The generic type to which this resource is adapted
totype
- The Class object of the target type, such as
Node.class
null
if the resource cannot
adapt to the requested typepublic Resource getResource()
SlingHttpServletRequest
Resource
object on whose behalf the servlet acts.
getResource
in interface SlingHttpServletRequest
Resource
object of this request.public ResourceResolver getResourceResolver()
SlingHttpServletRequest
ResourceResolver
which resolved the
resource
of this request.
getResourceResolver
in interface SlingHttpServletRequest
public RequestProgressTracker getRequestProgressTracker()
SlingHttpServletRequest
RequestProgressTracker
of this request.
getRequestProgressTracker
in interface SlingHttpServletRequest
public javax.servlet.RequestDispatcher getRequestDispatcher(Resource resource)
null
if resource
is null
.
getRequestDispatcher
in interface SlingHttpServletRequest
public javax.servlet.RequestDispatcher getRequestDispatcher(Resource resource, RequestDispatcherOptions options)
null
if resource
is null
.
getRequestDispatcher
in interface SlingHttpServletRequest
resource
- The Resource
instance whose response content may
be included by the returned dispatcher.options
- influence the rendering of the included Resource
RequestDispatcher
object that acts as a wrapper
for the resource
or null
if an
error occurs preparing the dispatcher.public javax.servlet.RequestDispatcher getRequestDispatcher(String path)
null
if path
is null
.
getRequestDispatcher
in class javax.servlet.ServletRequestWrapper
public javax.servlet.RequestDispatcher getRequestDispatcher(String path, RequestDispatcherOptions options)
null
if path
is null
.
getRequestDispatcher
in interface SlingHttpServletRequest
path
- a String
specifying the pathname to the
resource. If it is relative, it must be relative against the
current servlet.options
- influence the rendering of the included Resource
RequestDispatcher
object that acts as a wrapper
for the resource
or null
if an
error occurs preparing the dispatcher.public String getParameter(String name)
getParameter
in interface javax.servlet.ServletRequest
getParameter
in class javax.servlet.ServletRequestWrapper
ServletRequestWrapper.getParameter(java.lang.String)
public Map<String,String[]> getParameterMap()
getParameterMap
in class javax.servlet.ServletRequestWrapper
ServletRequestWrapper.getParameterMap()
public Enumeration<String> getParameterNames()
getParameterNames
in interface javax.servlet.ServletRequest
getParameterNames
in class javax.servlet.ServletRequestWrapper
ServletRequestWrapper.getParameterNames()
public String[] getParameterValues(String name)
getParameterValues
in interface javax.servlet.ServletRequest
getParameterValues
in class javax.servlet.ServletRequestWrapper
ServletRequestWrapper.getParameterValues(java.lang.String)
public RequestParameter getRequestParameter(String name)
SlingHttpServletRequest
RequestParameter
,
or null
if the parameter does not exist.
This method should only be used if the parameter has only one value. If
the parameter might have more than one value, use
SlingHttpServletRequest.getRequestParameters(String)
.
If this method is used with a multivalued parameter, the value returned
is equal to the first value in the array returned by
getRequestParameters
.
This method is a shortcut for
getRequestParameterMap().getValue(String)
.
getRequestParameter
in interface SlingHttpServletRequest
name
- a String
specifying the name of the parameter
RequestParameter
representing the single value of the
parameterSlingHttpServletRequest.getRequestParameter(java.lang.String)
public RequestParameter[] getRequestParameters(String name)
SlingHttpServletRequest
RequestParameter
objects containing all of
the values the given request parameter has, or null
if the
parameter does not exist.
If the parameter has a single value, the array has a length of 1.
This method is a shortcut for
getRequestParameterMap().getValues(String)
.
getRequestParameters
in interface SlingHttpServletRequest
name
- a String
containing the name of the parameter
the value of which is requested
RequestParameter
objects containing the
parameter values.SlingHttpServletRequest.getRequestParameters(java.lang.String)
public RequestParameterMap getRequestParameterMap()
SlingHttpServletRequest
Map
of the parameters of this request.
The values in the returned Map
are from type
RequestParameter
array (RequestParameter[]
).
If no parameters exist this method returns an empty Map
.
getRequestParameterMap
in interface SlingHttpServletRequest
Map
containing parameter names as
keys and parameter values as map values, or an empty
Map
if no parameters exist. The keys in the
parameter map are of type String. The values in the parameter map
are of type RequestParameter
array (RequestParameter[]
).SlingHttpServletRequest.getRequestParameterMap()
public javax.servlet.http.Cookie getCookie(String name)
SlingHttpServletRequest
null
if
no such cookie exists in the request.
getCookie
in interface SlingHttpServletRequest
name
- The name of the cookie to return.
null
if no such cookie exists.SlingHttpServletRequest.getCookie(java.lang.String)
public RequestPathInfo getRequestPathInfo()
SlingHttpServletRequest
RequestPathInfo
pertaining to this request.
getRequestPathInfo
in interface SlingHttpServletRequest
SlingHttpServletRequest.getRequestPathInfo()
public ResourceBundle getResourceBundle(Locale locale)
SlingHttpServletRequest
getResourceBundle
in interface SlingHttpServletRequest
locale
- the locale for which to retrieve the resource bundle. If
this is null
, the locale returned by
#getLocale()
is used to select the resource bundle.
SlingHttpServletRequest.getResourceBundle(java.util.Locale)
public ResourceBundle getResourceBundle(String baseName, Locale locale)
SlingHttpServletRequest
getResourceBundle
in interface SlingHttpServletRequest
baseName
- The base name of the resource bundle to returned. If this
parameter is null
, the same resource bundle
must be returned as if the SlingHttpServletRequest.getResourceBundle(Locale)
method is called.locale
- the locale for which to retrieve the resource bundle. If
this is null
, the locale returned by
#getLocale()
is used to select the resource bundle.
SlingHttpServletRequest.getResourceBundle(String, Locale)
public String getResponseContentType()
SlingHttpServletRequest
For included resources this method will returned the same string as
returned by the ServletResponse.getContentType()
without
the character set.
getResponseContentType
in interface SlingHttpServletRequest
SlingHttpServletRequest.getResponseContentType()
public Enumeration<String> getResponseContentTypes()
SlingHttpServletRequest
For included resources this method will returned an enumeration
containing a single entry which is the same string as returned by the
ServletResponse.getContentType()
without the character
set.
getResponseContentTypes
in interface SlingHttpServletRequest
SlingHttpServletRequest.getResponseContentTypes()
public javax.servlet.ServletInputStream getInputStream() throws IOException
getInputStream
in interface javax.servlet.ServletRequest
getInputStream
in class javax.servlet.ServletRequestWrapper
IOException
ServletRequestWrapper.getInputStream()
public BufferedReader getReader() throws UnsupportedEncodingException, IOException
getReader
in interface javax.servlet.ServletRequest
getReader
in class javax.servlet.ServletRequestWrapper
UnsupportedEncodingException
IOException
ServletRequestWrapper.getReader()
public Principal getUserPrincipal()
getUserPrincipal
in class javax.servlet.http.HttpServletRequestWrapper
HttpServletRequestWrapper.getUserPrincipal()
public boolean isUserInRole(String role)
isUserInRole
in class javax.servlet.http.HttpServletRequestWrapper
HttpServletRequestWrapper.isUserInRole(String)
public String getServletPath()
getServletPath
in interface javax.servlet.http.HttpServletRequest
getServletPath
in class javax.servlet.http.HttpServletRequestWrapper
public String getPathInfo()
getPathInfo
in interface javax.servlet.http.HttpServletRequest
getPathInfo
in class javax.servlet.http.HttpServletRequestWrapper
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |