[opencms-dev] Templates with JSP pages issue
Yves Glodt
yg at mind.lu
Wed Dec 24 11:09:01 CET 2008
Hello,
I have a problem with a template I created which I use in jsp pages.
The template contains some "custom code", look for "// some custom code here",
and it looks like this code gets executed one time for each of the following
sections in page.jsp:
<cms:include property="template" element="..." />
So several times in my case.
Is that a normal behaviour? If yes, is it possible to know in which "section"
the execution takes place?
Best regards,
Yves
-------------- next part --------------
<%@ page session="true" %>
<%@ page import="org.opencms.jsp.*" %>
<%@ page import="org.opencms.mail.*" %>
<%@ page import="java.util.*" %>
<%@ page import="com.site.dao.*" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %>
<cms:include property="template" element="header" />
<cms:include property="template" element="openbodyviewport" />
<cms:include property="template" element="top" />
<cms:include property="template" element="navigation" />
<div id='content'>
<%
// custom jsp code here
%>
</div>
<cms:include property="template" element="footer" />
<cms:include property="template" element="closebodyviewport" />
-------------- next part --------------
<%@ page session="true" %>
<%@ page import="org.opencms.*" %>
<%@ page import="org.opencms.main.*" %>
<%@ page import="org.opencms.flex.*" %>
<%@ page import="org.opencms.jsp.*" %>
<%@ page import="org.opencms.file.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.sql.*" %>
<%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
// some custom code here
%>
<cms:template element="header">
</cms:template>
<cms:template element="openbodyviewport">
</cms:template>
<cms:template element="top">
</cms:template>
<cms:template element="navigation">
</cms:template>
<cms:template element="content">
<div id='content'>
<cms:include element="body" editable="true" />
</div>
</cms:template>
<cms:template element="footer">
</cms:template>
<cms:template element="closebodyviewport">
</cms:template>
More information about the opencms-dev
mailing list