|
|||||||
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.opencms.flex.CmsFlexRequest
Wrapper class for a HttpServletRequest.
This class wraps the standard HttpServletRequest so that it's output can be delivered to the CmsFlexCache.
Field Summary | |
static java.lang.String |
PARAMETER_FLEX
Request parameter for FlexCache commands. |
Fields inherited from interface javax.servlet.http.HttpServletRequest |
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH |
Constructor Summary | |
CmsFlexRequest(javax.servlet.http.HttpServletRequest req,
CmsFlexController controller)
Creates a new CmsFlexRequest wrapper which is most likley the "Top" request wrapper, i.e. the wrapper that is constructed around the first "real" (not wrapped) request. |
Method Summary | |
java.util.Map |
addParameterMap(java.util.Map map)
Adds the specified Map to the paramters of the request, added parametes will not overwrite existing parameters in the request. |
protected java.util.List |
getCmsIncludeCalls()
Returns the List of include calls which will be passed to the next wrapping layer. |
java.lang.String |
getElementRootPath()
Returns the full element URI site root path to the resource currently processed. |
java.lang.String |
getElementUri()
Returns the element URI of the resource currently processed, relative to the current site root. |
java.lang.String |
getParameter(java.lang.String name)
Return the value of the specified request parameter, if any; otherwise, return null . |
java.util.Map |
getParameterMap()
Returns a Map of the parameters of this request. |
java.util.Enumeration |
getParameterNames()
Return the names of all defined request parameters for this request. |
java.lang.String[] |
getParameterValues(java.lang.String name)
Returns the defined values for the specified request parameter, if any; otherwise, return null . |
javax.servlet.RequestDispatcher |
getRequestDispatcher(java.lang.String target)
Allows requests to be dispatched to internal VFS resources or external JSP pages, overloads the standard servlet API getRequestDispatcher() method. |
CmsFlexRequestDispatcher |
getRequestDispatcherToExternal(java.lang.String vfs_target,
java.lang.String ext_target)
Replacement for the standard servlet API getRequestDispatcher() method. |
java.lang.String |
getRequestURI()
Wraps the request URI, overloading the standard API. |
java.lang.StringBuffer |
getRequestURL()
Wraps the request URL, overloading the standard API, the wrapped URL will always point to the currently included VFS resource. |
boolean |
isDoRecompile()
Checks if JSPs should always be recompiled. |
boolean |
isOnline()
Indicates that this request belongs to an online project. |
void |
setParameterMap(java.util.Map map)
Sets the specified Map as paramter map of the request. |
java.lang.String |
toString()
|
Methods inherited from class javax.servlet.http.HttpServletRequestWrapper |
getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getServletPath, getSession, getSession, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole |
Methods inherited from class javax.servlet.ServletRequestWrapper |
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocale, getLocales, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRequest, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding, setRequest |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface javax.servlet.ServletRequest |
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocale, getLocales, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding |
Field Detail |
public static final java.lang.String PARAMETER_FLEX
Constructor Detail |
public CmsFlexRequest(javax.servlet.http.HttpServletRequest req, CmsFlexController controller)
req
- the request to wrapcontroller
- the controller to useMethod Detail |
public java.util.Map addParameterMap(java.util.Map map)
Remember that the value for a parameter name in a HttpRequest is a String array. If a parameter name already exists in the HttpRequest, the values will be added to the existing value array. Multiple occurences of the same value for one paramter are also possible.
map
- the map to add
public java.lang.String getElementRootPath()
public java.lang.String getElementUri()
This might be the name of an included resource, not neccesarily the name the resource requested by the user.
public java.lang.String getParameter(java.lang.String name)
null
.If there is more than one value defined, return only the first one.
name
- the name of the desired request parameter
ServletRequest.getParameter(java.lang.String)
public java.util.Map getParameterMap()
Map
of the parameters of this request.Request parameters are extra information sent with the request. For HTTP servlets, parameters are contained in the query string or posted form data.
Map
containing parameter names as keys
and parameter values as map valuesServletRequest.getParameterMap()
public java.util.Enumeration getParameterNames()
ServletRequest.getParameterNames()
public java.lang.String[] getParameterValues(java.lang.String name)
null
.
name
- Name of the desired request parameter
null
otherwiseServletRequest.getParameterValues(java.lang.String)
public javax.servlet.RequestDispatcher getRequestDispatcher(java.lang.String target)
getRequestDispatcher()
method.
target
- the target for the request dispatcher
public CmsFlexRequestDispatcher getRequestDispatcherToExternal(java.lang.String vfs_target, java.lang.String ext_target)
This variation is used if an external file (probably JSP) is dispached to. This external file must have a "mirror" version, i.e. a file in the OpenCms VFS that represents the external file.
vfs_target
- the OpenCms file that is a "mirror" version of the external fileext_target
- the external file (outside the OpenCms VFS)
public java.lang.String getRequestURI()
This ensures that any wrapped request will use the "faked" target parameters. Remember that for the real request, a mixture of PathInfo and other request information is used to idenify the target.
HttpServletRequest.getRequestURI()
public java.lang.StringBuffer getRequestURL()
HttpServletRequest.getRequestURL()
public boolean isDoRecompile()
This is useful in case directive based includes are used with <%@ include file="..." %> on a JSP. Note that this also forces the request not to be cached.
public boolean isOnline()
This is required to distinguish between online and offline resources in the cache. Since the resources have the same name, a suffix [online] or [offline] is added to distinguish the strings when building cache keys. Any resource from a request that isOnline() will be saved with the [online] suffix and vice versa.
Resources in the OpenCms workplace are not distinguised between online and offline but have their own suffix [workplace]. The assumption is that if you do change the workplace, this is only on true development macines so you can do the cache clearing manually if required.
The suffixes are used so that we have a simple String name for the resources in the cache. This makes it easy to use a standard HashMap for storage of the resources.
public void setParameterMap(java.util.Map map)
The map set should be immutable. This will completly replace the parameter map. Use this in combination with getParameterMap() and addParameterMap() in case you want to set the old status of the parameter map after you have modified it for a specific operation.
map
- the map to setpublic java.lang.String toString()
Object.toString()
protected java.util.List getCmsIncludeCalls()
The set of include calls is maintained to dectect an endless inclusion loop.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |