[opencms-dev] HELP needed - template elements
Andy Kriger
akriger at greaterthanone.com
Tue Sep 7 23:13:38 CEST 2004
I am having a problem using template elements in a JSP page.
I have a JSP template that uses <cms:template element="...">some
content</cms:template> to declare element blocks (based on many examples I
have found in mailing list posts and in the OpenCms book). When I try to use
these blocks in a JSP page, however, I can only use one include, otherwise I
get a Resource loader error (FlexDispatcher: Detected inclusion loop for
target).
Included below are the page and template. If I comment out the head or foot
include in the JSP page, then the other element will show up in the compiled
page. But if both includes are there, then I get the error.
Does anyone know why I cannot include both head and foot at the same time?
Here is the JSP page
<%@ page session="false" %>
<%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %>
<cms:include property="template" element="head"/>
FOOEY!
<cms:include property="template" element="foot"/>
Here is the JSP template
<%@ page session="false" %>
<%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %>
<!DOCTYPE html public "-//W3C/DTD HTML 4.01 Transitional//EN">
<cms:template element="head">
<html>
<head>
<title>
<cms:property name="title" escapeHtml="true"/>
</title>
</head>
<body>
<h1>
<cms:property name="title" escapeHtml="true"/>
</h1>
</cms:template>
<cms:template element="body">
<cms:include element="body"/>
</cms:template>
<cms:template element="foot">
</body>
</html>
</cms:template>
Andy Kriger | Software Director | Greater Than One, Inc.
395 Hudson Street | 5th Floor | New York, NY 10014
P: 212.252.7197 | F: 212.252.7364 | E: akriger at greaterthanone.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20040907/7014223e/attachment.htm>
More information about the opencms-dev
mailing list