[opencms-dev] Inclusion loop error while working on HowTo's

Marc Davenport mdavenport at endeca.com
Tue Oct 26 16:30:37 CEST 2004


Hello all,

I'm very new to using OpenCMS.  I've been working my way through the Howto
documents.  I cannot get the basic jsp hot to to work.  I am getting a
Resource loader error.  The description is Dected inclusion loop for target
'........./form1.jsp'.   Here are my very simple pages.  Could someone
please glance at them and let me know what I'm doing wrong.  there are
people in teh archives with similar problems, but I couldnt find a
resolution.  Any help would be much appreciated.

Marc Davenport


Truncated Error message
=============================
javax.servlet.ServletException: Resource loader error in file
'/system/modules/com.opencms.endeca/form1.jsp'

Root cause:
javax.servlet.ServletException: javax.servlet.jsp.JspException:
FlexDispatcher: Dectected inclusion loop for target
/system/modules/com.opencms.endeca/form1.jsp
	at
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextI
mpl.java:821)




{root}/templates/main.xml
===========================================
<?xml version="1.0" encoding="ISO-8859-1"?>

<!-- This links the XMLTemplate mechanism with the JSP templates.
     So far it is required because the WYSIWYG editor still is
     completly based on the XMLTemplates. -->
<xmltemplate>

<!-- Define the stylesheet for the WYSIWYG editor -->
<stylesheet> /system/modules/com.opencms.endeca/resources/main.css
</stylesheet>

<!-- Template description, pretty short for a JSP template -->
<template>
    <element name="jsptemplate" />
</template>

<!-- This describes the "jsptemplate" element used above.
     Important: The element must NOT be called "frametemplate",
     because in that case the stylesheet does not work. -->

<elementdef name="jsptemplate">

    <!-- Always use this class tag when inserting a JSP element in your
page: -->
    <class>com.opencms.flex.CmsJspTemplate</class>   

    <!-- Just add the path to your JSP here: -->
    <template>../jsptemplates/main.jsp</template>

</elementdef>
    
</xmltemplate>



{root}/jsptemplates/main.jsp
===================================
<%@ page import="com.opencms.flex.jsp.*" %>
<%@ page session="false" %>
<%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %>

<cms:template element="head">
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title><cms:property name="title" escapeHtml="true" /></title>

<link type="text/css" rel="stylesheet"
href="<cms:link>../resources/main.css</cms:link>">
</head>
<body>
<h2>My first template head</h2>
<!-- Main page body starts here -->
</cms:template>


<cms:template element="body">
     <cms:include element="body" />
</cms:template>

<cms:template element="foot">
<!-- Main page body ends here -->

<h2>My first template foot</h2>

</body>
</html>
</cms:template>



Lastly, {root} form1.jsp
===================================
<%@ page session="false" %>
<%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %>

<cms:include property="template" element="head" />

<%   
String name = request.getParameter("name");
if (name != null) {
%>
<h2>Your name is: <%= name %></h2>
<% } %>

<form name="test" method="get" action="form1.jsp">
<p>Enter your name: <input name="name" size="20" value="">  <input
type="submit" value="OK"></p>
</form>   

<cms:include property="template" element="foot" />



This email message and any attachments are confidential to Endeca. If you
are not the intended recipient, please notify Endeca immediately -- by
replying to this message or by sending an email to: legal at endeca.com -- and
destroy all copies of this message and any attachments. Thank you.



More information about the opencms-dev mailing list