[opencms-dev] Is something wrong with cms:include when nested?
Stefan Uldum Grinsted
stefan at e-nation.dk
Mon Sep 4 21:38:06 CEST 2006
Hi list (and OpenCMS developers)
I know nested Tags always are a hurdle, but I have found a particular
strange behavior of cms:include in OpenCMS 6.2.2 when nesting it inside a
c:set.
I have replicated it using the following. I have 3 files:
- blank.txt
- child.txt
- parent.jsp
The blank.txt is of course an empty file of the type plain.
The child.txt is a plain document containing the following line:
I am a child
The parent.jsp looks like this:
<%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="child">
<cms:include page="child.txt" />
</c:set>
This should be the child: ${child}<br/>
And it should have ended here, because this should be the blank.txt:<br/>
<cms:include page="blank.txt" />
If it wasn't for the last line, including the blank file, nothing is in the
response. Not even the "This should be the child"-text
I tried to add the last line mostly because I have tried everything else,
and the most peculiar thing is, the response then looks like this:
This should be the child: <br/>
And it should have ended here, because this should be the blank.txt:<br/>
I am a child
I would have just used a <cms:include page="child.txt" var="child" /> if
such a functionality had been available, as it unfortunately isn't.. yet.
The reason for all this hurdle is that I have a jsp, which generates a menu
structure as xml, which is the "child" I want to include, and then use the
xml:transform from jstl to generate some html for the menu.
The use of xml:transform brought up some issues itself. Is it true that the
jar file xalan.jar is modified in the opencms distribution?
Usually the org/apache/xalan/res/XSLTInfo.properties has the following
lines:
org.xml.sax.driver=org.apache.xerces.parsers.SAXParser
# org.xml.sax.driver=org.apache.crimson.parser.XMLReaderImpl
But the one in the opencms distribution has these lines:
# org.xml.sax.driver=org.apache.xerces.parsers.SAXParser
org.xml.sax.driver=org.apache.crimson.parser.XMLReaderImpl
And that is even though the crimson parser is not part of the classpath.
(not on Tomcat 5.5 running on JDK 5). And that resulted in the following
error:
"SAX2 driver class org.apache.crimson.parser.XMLReaderImpl not found"
But when I commented out the line which sets the driver class in the
properties file, everything worked fine.
Anyways. This last bit was a bit of a side-kick, but the original problem
remains. And I would really like to figure out why you can't nest
cms:include inside c:out.
Good evening, and enjoy.
Cheers, Stefan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20060904/e59dcbed/attachment.htm>
More information about the opencms-dev
mailing list