|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--javax.servlet.ServletRequestWrapper
|
+--javax.servlet.http.HttpServletRequestWrapper
|
+--com.opencms.flex.cache.CmsFlexRequest
Wrapper class for a HttpServletRequest.
This class wrapps the standard HttpServletRequest so that it's output can be delivered to the CmsFlexCache.
| Field Summary | |
static String |
C_ATTR_PROCESSED
|
| Fields inherited from interface javax.servlet.http.HttpServletRequest |
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH |
| Constructor Summary | |
CmsFlexRequest(CmsFlexRequest req,
String resource)
Constructs a new wrapper layer around a (already wrapped) CmsFlexRequest. |
|
CmsFlexRequest(javax.servlet.http.HttpServletRequest req,
CmsFile file,
CmsFlexCache cache,
CmsObject cms)
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 | |
Map |
addParameterMap(Map map)
Adds the specified Map to the paramters of the request. |
CmsFlexCache |
getCmsCache()
Returns the CmsFlexCache instance where all results from this request will be cached in. |
CmsFile |
getCmsFile()
This method provides access to the top-level CmsFile of the request which is of a type that supports the FlexCache, i.e. usually the CmsFile that is identical to the file uri requested by the user, not he current included element. |
protected Set |
getCmsIncludeCalls()
Returns the Set of include calls which will be passed to the next wrapping layer. |
CmsObject |
getCmsObject()
Returns the CmsObject that belongs to the request. |
CmsFlexRequestDispatcher |
getCmsRequestDispatcher(String target)
Replacement for the standard servlet API getRequestDispatcher() method. |
CmsFlexRequestDispatcher |
getCmsRequestDispatcher(String cms_target,
String ext_target)
Replacement for the standard servlet API getRequestDispatcher() method. |
String |
getCmsRequestedResource()
Returns the OpenCms URI of the resource requested by the user. |
String |
getCmsResource()
Returns the name of the resource currently processed. |
javax.servlet.http.HttpServletRequest |
getCmsTopRequest()
This returns the "Top" request, i.e. the first wrapped request that is not of type CmsFlexRequest. |
String |
getParameter(String name)
Return the value of the specified request parameter, if any; otherwise, return null. |
Map |
getParameterMap()
Returns a Map of the parameters of this request. |
Enumeration |
getParameterNames()
Return the names of all defined request parameters for this request. |
String[] |
getParameterValues(String name)
Returns the defined values for the specified request parameter, if any; otherwise, return null. |
javax.servlet.RequestDispatcher |
getRequestDispatcher(String target)
Overloads the standard servlet API getRequestDispatcher() method, which is the main purpose of this wrapper implementation. |
String |
getRequestURI()
Wraps the request URI, overloading the standard API. |
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(Map map)
Sets the specified Map as paramter map of the request. |
String |
toAbsolute(String location)
Convert (if necessary) and return the absolute URI that represents the resource referenced by this possibly relative URI for this request. |
| 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, toString, 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 String C_ATTR_PROCESSED
| Constructor Detail |
public CmsFlexRequest(javax.servlet.http.HttpServletRequest req,
CmsFile file,
CmsFlexCache cache,
CmsObject cms)
file - the CmsFile (target resource) that has been requestedreq - the request to wrapcache - the CmsFlexCache used to store the cached result (needed by the dispatcher)cms - the CmsObject for this request, containing the user authorization, needed by the dispatcher
public CmsFlexRequest(CmsFlexRequest req,
String resource)
req - the request to be wrappedresource - the target resource that has been requested| Method Detail |
public javax.servlet.http.HttpServletRequest getCmsTopRequest()
This is needed for access to the requestDispatcher of this top request, which is used to access external resources (like JSP files that must reside in the file system).
public CmsObject getCmsObject()
public CmsFlexCache getCmsCache()
This is public so that pages like the Flex Cache Administration page have a way to access the cache object.
public CmsFile getCmsFile()
In case a JSP is used as a sub-element in a XMLTemplate, this method will not return the top-level uri but the "topmost" file of a type that is supported by the FlexCache. In case you need the top uri, use getCmsObject().getRequestContext().getUri().
public String getCmsResource()
This might be the name of an included resource, not neccesarily the name the resource requested by the user.
getCmsRequestedResource()public String getCmsRequestedResource()
This might not be the resource currently processed,
which might be an included resource.
Same as calling CmsRequestContext.getUri().
getCmsResource(),
CmsRequestContext.getUri()public String toAbsolute(String location)
Adjust for resources in the OpenCms VFS by cutting of servlet context and servlet name. If this URI is already absolute, return it unchanged. Return URI also unchanged if it is not well-formed.
location - URI to be (possibly) converted and then returned
public CmsFlexRequestDispatcher getCmsRequestDispatcher(String cms_target,
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.
cms_target - the OpenCms file that is a "mirror" version of the external fileext_target - the external file (outside the OpenCms VFS)
public CmsFlexRequestDispatcher getCmsRequestDispatcher(String target)
This variation can be used if you know that you are dealing with a CmsFlexRequest, so you can avoid casting the result of getRequestDispatcher() to the CmsFlexRequestDispatcher.
target - the target for the request dispatcher
public javax.servlet.RequestDispatcher getRequestDispatcher(String target)
getRequestDispatcher in interface javax.servlet.ServletRequestgetRequestDispatcher in class javax.servlet.ServletRequestWrappertarget - the target for the request dispatcher
public 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.
getRequestURI in interface javax.servlet.http.HttpServletRequestgetRequestURI in class javax.servlet.http.HttpServletRequestWrapperHttpServletRequest.getRequestURI()public String getParameter(String name)
null.If there is more than one value defined, return only the first one.
getParameter in interface javax.servlet.ServletRequestgetParameter in class javax.servlet.ServletRequestWrappername - the name of the desired request parameterServletRequest.getParameter(java.lang.String)public 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.
getParameterMap in interface javax.servlet.ServletRequestgetParameterMap in class javax.servlet.ServletRequestWrapperMap containing parameter names as keys
and parameter values as map valuesServletRequest.getParameterMap()public Enumeration getParameterNames()
getParameterNames in interface javax.servlet.ServletRequestgetParameterNames in class javax.servlet.ServletRequestWrapperServletRequest.getParameterNames()public String[] getParameterValues(String name)
null.
getParameterValues in interface javax.servlet.ServletRequestgetParameterValues in class javax.servlet.ServletRequestWrappername - Name of the desired request parameter
null otherwiseServletRequest.getParameterValues(java.lang.String)public Map addParameterMap(Map map)
Added parametes will not overwrite existing parameters in the request. 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 void setParameterMap(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 StringBuffer getRequestURL()
getRequestURL in interface javax.servlet.http.HttpServletRequestgetRequestURL in class javax.servlet.http.HttpServletRequestWrapperHttpServletRequest.getRequestURL()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.
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 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.
protected Set 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 | ||||||||||