[opencms-dev] HELP needed - template problem

Andy Kriger akriger at greaterthanone.com
Tue Sep 7 20:14:05 CEST 2004


I am completely new to OpenCms and am playing around with templates and
files. I have setup a module with a template (in templates/ as XML and in
jsptemplates/ as JSP). This template appears in the dropdown list when I
create a file in the project directory under the Root folder. I can preview
the file in the WYSIWYG editor and see that it is using the template.

However, when I try to view the file in the browser, I get a 404 error. If I
set the template for the file to something from the Alkacon docs or to Empty
template, the file loads in the OpenCms application using that template. I
don't see any useful error messages in the opencms log file or the appserver
logs.

I'm guessing the problem lies with my template files (included below). They
are setup in /system/modules/com.gto.cms using the standard directory
structure (templates for XMLs and jsptemplates for JSPs). Can anyone help me
figure out what's going on?

A side note that's not clear and may be affecting this - do I need to
publish module files in the same way that project files are published or are
changes to module files automatically available to projects?

-------

This is the XML template

<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
  - Template for example.com site. Loads a JSP template
  -->
<xmltemplate>
  <stylesheet/>
  <template>
    <element name="jsptemplate"/>
  </template>
  <elementdef name="jsptemplate">
    <class>com.opencms.flex.CmsJspTemplate</class>   
    <template>../jsptemplates/basic-gto-template.jsp</template>
  </elementdef>
</xmltemplate>

And this 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">

<html>
<head>
<title>
  <cms:property name="title" escapeHtml="true"/>
</title>
</head>
<body>
  <h1>
    <cms:property name="title" escapeHtml="true"/>
  </h1>
  <cms:include element="body"/>
</body>
</html>

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/9053cb5a/attachment.htm>


More information about the opencms-dev mailing list