|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.flex.CmsFlexRequestDispatcher
public class CmsFlexRequestDispatcher
Implementation of the
interface to allow JSPs to be loaded
from the OpenCms VFS.RequestDispatcher
This dispatcher will load data from 3 different data sources:
Constructor Summary | |
---|---|
CmsFlexRequestDispatcher(javax.servlet.RequestDispatcher rd,
java.lang.String vfs_target,
java.lang.String ext_target)
Creates a new instance of CmsFlexRequestDispatcher. |
Method Summary | |
---|---|
void |
forward(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse res)
Wrapper for the standard servlet API call. |
void |
include(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse res)
Wrapper for dispatching to a file from the OpenCms VFS. |
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, java.lang.String vfs_target, java.lang.String ext_target)
rd
- the "real" dispatcher, used for include call to file systemvfs_target
- the cms resource that represents the external targetext_target
- the external target that the request will be dispatched toMethod Detail |
---|
public void forward(javax.servlet.ServletRequest req, javax.servlet.ServletResponse res) throws javax.servlet.ServletException, java.io.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.RequestDispatcher
req
- the servlet requestres
- the servlet response
javax.servlet.ServletException
- in case something goes wrong
java.io.IOException
- in case something goes wrongRequestDispatcher.forward(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
public void include(javax.servlet.ServletRequest req, javax.servlet.ServletResponse res) throws javax.servlet.ServletException, java.io.IOException
This method will dispatch to cache, to real file system or to the OpenCms VFS, whatever is needed.
This method is much more complex than it should 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 buffered stream,
but without includes. Then it is parsed again later
in the
, enriched with the
included elements that have been omitted in the first case.
I would love to see a simpler solution, but this works for now.CmsFlexResponse
include
in interface javax.servlet.RequestDispatcher
req
- the servlet requestres
- the servlet response
javax.servlet.ServletException
- in case something goes wrong
java.io.IOException
- in case something goes wrong
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |