[opencms-dev] Caching Problem
M Butcher
mbutcher at grcomputing.net
Fri Jan 23 08:40:02 CET 2004
If you set cache=never (where cache is a property for the JSP page) on
both One.jsp and Two.jsp does anything change? If I understand the
FlexCache documentation correctly, this should force the recompilation
(and, I believe, the re-writing of VFS to FS) for the JSP. Since
FlexCache directives are per-file, you have to set it for each included JSP.
Matt
Raza Naqvi wrote:
> Let me explain what exactly the problem.
>
> lets take the following example
>
> Main.jsp : -
>
> <%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %>
> <br>
> <cms:include file="One.jsp" />
> <br>
> <cms:include file="Two.jsp" />
>
> One.jsp: -
>
> This line is from One
>
> Two.jsp:-
>
> This line is from Two
>
>
> If i run the Main.jsp I am getting the following output
> This line is from One
> This line is from Two
>
> If i change any of the jsp's either one or two.
>
> That code is not getting updated. If i check the real FS . (The code is
> not updated)
> If i run the JSP individually then its getting re-loaded. I am just
> wondering, is it a functionality or any other configuration problems.
> But as per the documentation the main.jsp should compile the included
> jsp's and copy the jsp into the real FS and then.... continue the
> process. Is it required to compile the included jsp's each and every
> time?
> Please help me.
>
> As per the documentation if you include (use jsp:include or cms:include
> or @ page etc) any page it should do the following steps
>
> To enable OpenCms to be independed of the servlet container, it uses a
> simple trick - it mirrors it's JSP's from the VFS to the "real" file
> system like this:
> 1. All requests for OpenCms resources are handled by the OpenCms servlet,
> usually mapped to /opencms/opencms.
> 2. In case OpenCms receives a request for a JSP resource, it dumps the
> contents of the requested JSP into it's own web application home
> directory in the subfolder /WEB-INF/jsp.
> 3. Since OpenCms distinguishes between online and offline resources, a
> subfolder online or offline is appended to this directory.
> 4. In this folders, the dumped JSP files will be written with their full
> VFS path and, an ".jsp" suffix will always be appended to the filename.
>
> 5. For example if your JSP is called "/index.jsp" in the OpenCms VFS, it
> will be mirrored to /WEB-INF/jsp/online/index.jsp.jsp in the "real"
> file system. Lets call this the "translated filename" of the JSP.
> 6. While OpenCms dumps the resource, a preprocessing of the JSP contents
> is made with a simple parser to find directives that refer to other JSP
> filenames. Most notably this is <%@ include file= "..." %> and <%@ page
> errorPage= "..."%>. If such a directive is found, the target file name
> is replaced with the translated filename for this resource in the real
> FS.
> 7. Now we have a JSP file in a web application directory with the name,
> let's say, "{file.jsp}".
> 8. The OpenCms servlet (that still has the control) now calls
> requestDispatcher("{file.jsp}").include() and transfers control to the
> standard servlet container. This will just do all of the steps described
> above for the "standard" JSP in the web application. Note that during
> this process, OpenCms also uses Request and Response wrappers to
> generate entries for the
> FlexCache. See the FlexCache Reference for more details.
>
> Regards,
> Raza
>
>
> _____________________________________________________________
> I use Krify Mail - http://mail.krify.com Get Yourname at Krify today!
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://mail.opencms.org/mailman/listinfo/opencms-dev
More information about the opencms-dev
mailing list