[opencms-dev] Strange JSP compile behaviour

Joe Lam joe.lam at moni-media.net
Sat Sep 16 12:22:29 CEST 2006


I did similar thing. Not sure if the problem I got was the same as yours.
I have JSP files include lib/aaa.include file. and also the aaa.include 
file includes another file.
the relative path in aaa.include's <@ include> tag caused error.
seems it is safe to use relative path in JSP. for those files being 
included, you need to pay attention on the path.

hope this help

Joe



> For convenience I put common template code into "library" JSP files in
> a "lib" directory which I include at the top of my template JSP
> scripts... so my template module directory layout is something like:
>
> (module dir)/resources/
> (module dir)/templates/
> (module dir)/templates/lib/
>
> At the top of my template JSP scripts I have an include, something like:
> <%@include file="lib/_jsp_header.jsp"%>
>
> This works very well, 99.99% of the time. But very occasionally (and
> this seems to happen after a manual purge of the FlexCache) the live
> site randomly reports 500 errors. The jist of the error is a JSP
> compilation error: cannot find file "lib/lib/_jsp_header.jsp". Note
> that it's looking for my include relative to the lib directory -- not
> the template directory.
>
> Even stranger: if I reload the problematic page a few times it
> sometimes works and sometimes reports the 500 error.  It's like it's
> broken in some server threads and not others.
>
> Can anyone think of a possible cause of this. Of course I could hard
> code absolute path's in my includes, but that would be ugly IMHO.
>
> This must be a bug of some sort. I would have thought that the
> "current directory" when looking for include files during compile
> should be the same in all cases.
>
> I am using OpenCms 6.0.4, Tomcat 5.5.9, JDK 1.5.0_07 on Linux.
>
> Joe.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20060916/cf3eee2f/attachment.htm>


More information about the opencms-dev mailing list