|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.opencms.flex.cache.CmsFlexRequestDispatcher
Implementation of the javax.servlet.RequestDispatcher interface to allow JSPs to be loaded from OpenCms.
This dispatcher will load data from 3 different data sources:
| Constructor Summary | |
CmsFlexRequestDispatcher(javax.servlet.RequestDispatcher rd,
String target,
CmsFlexCache cache,
CmsObject cms)
Creates a new instance of CmsFlexRequestDispatcher. |
|
CmsFlexRequestDispatcher(javax.servlet.RequestDispatcher rd,
String target,
String ext_target,
CmsFlexCache cache,
CmsObject cms)
Creates a new instance of CmsFlexRequestDispatcher. |
|
| Method Summary | |
void |
forward(javax.servlet.ServletRequest servletRequest,
javax.servlet.ServletResponse servletResponse)
Wrapper for the standard servlet API call. |
void |
include(CmsFlexRequest req,
CmsFlexResponse res)
Wrapper for dispatching to a file from the OpenCms VFS. |
void |
include(javax.servlet.ServletRequest servletRequest,
javax.servlet.ServletResponse servletResponse)
Wrapper for the standard servlet API call. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public CmsFlexRequestDispatcher(javax.servlet.RequestDispatcher rd,
String target,
CmsFlexCache cache,
CmsObject cms)
rd - the "real" dispatcher, used for include call to file systemtarget - the target that the request will be dispatched tocache - the cache used for delivering and storing of cached pagescms - the CmsObject that is needed for authorization of internal calls to the OpenCms VFS<
public CmsFlexRequestDispatcher(javax.servlet.RequestDispatcher rd,
String target,
String ext_target,
CmsFlexCache cache,
CmsObject cms)
rd - the "real" dispatcher, used for include call to file systemtarget - the cms resource that represents the external targetext_target - the external target that the request will be dispatched tocache - the cache used for delivering and storing of cached pagescms - the CmsObject that is needed for authorization of internal calls to the OpenCms VFS| Method Detail |
public void forward(javax.servlet.ServletRequest servletRequest,
javax.servlet.ServletResponse servletResponse)
throws javax.servlet.ServletException,
IOException
Forward calls are actually NOT wrapped by OpenCms as of now. So they should not be used in JSP pages or servlets.
forward in interface javax.servlet.RequestDispatcherservletRequest - the servlet requestservletResponse - the servlet response
javax.servlet.ServletException - in case something goes wrong
IOException - in case something goes wrongRequestDispatcher.forward(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
public void include(javax.servlet.ServletRequest servletRequest,
javax.servlet.ServletResponse servletResponse)
throws javax.servlet.ServletException,
IOException
If you use standard include(), the call will be done by the standard request dispatcher. In case you want to include somthing from the Cms VFS, use includeFromCms() instead.
include in interface javax.servlet.RequestDispatcherservletRequest - The servlet requestservletResponse - The servlet response
javax.servlet.ServletException - In case something goes wrong
IOException - In case something goes wrongRequestDispatcher.include(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
public void include(CmsFlexRequest req,
CmsFlexResponse res)
throws javax.servlet.ServletException,
IOException
It was choosen NOT to overload the standard API include() call, since standard JSP might expect the standard behaviour from the RequestDispatcher, i.e. loading the files form the file system.
This method will dispatch to cache, to real file system or to the OpenCms VFS, whatever is needed.
This method is much more complex then it sould be because of the internal standard buffering of JSP pages. Because of that I can not just intercept and buffer the stream, since I don't have access to it (it is wrapped internally in the JSP pages, which have their own buffer). That leads to a solution where the data is first written to the bufferd stream, but without includes. Then it is parsed again later (in response.processCacheEntry()), enriched with the included elements that have been ommitted in the first case. I would love to see a simpler solution, but this works for now.
req - the servlet requestres - the servlet response
javax.servlet.ServletException - in case something goes wrong
IOException - in case something goes wrong
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||