[opencms-dev] flex: JSP and templates?

Alexander Kandzior alex at opencms.org
Fri Aug 30 12:28:58 CEST 2002


Hi Stefan, 

> another problem we are currently encountering is this:
> it doesn't seem to be possible to use templates for JSP 
> pages... is that correct?

This is true in the Flex alpha 1 release, but not longer in the 5.0 beta
1 release. We are currently preparing a (rather extensive) demo which
will show how you build a Template with JSP. 

Here's a code snippet for a template from the upcoming demo. You
probably get the idea. Place this in the "/content/templates" directory.

-------------------
<?xml version="1.0" encoding="utf-8"?>
<xmltemplate>
    <!-- This describes the template -->	
    <template>
        <element name="head"/>
        <element name="body"/>
        <element name="foot"/>
    </template>
        
    <!-- Include A JSP as "head" element: -->
    <elementdef name="head">
        <!-- This class is the same for all JSP -->
        <class>com.opencms.flex.CmsJspTemplate</class>
        <!-- Here goes the JSP file to include -->
        <template>demodefault_head.jsp</template>
    </elementdef>
    
    <!-- Include A JSP as "foot" element: -->
    <elementdef name="foot">
        <!-- This class is the same for all JSP -->
        <class>com.opencms.flex.CmsJspTemplate</class>
        <!-- Here goes the JSP file to include -->
        <template>demodefault_foot.jsp</template>
    </elementdef>        
</xmltemplate>
---------------------

Important: In case you use JSP - Templates, you currently must set the
"export" property to "false" for the pages since JSP can currently not
be exported. It's ok to set this proprty on a folder to prevent all
files in this folder from being exported. 


Best Regards,

Alex.

Alexander Kandzior
OpenCms Group / Alkacon Software





More information about the opencms-dev mailing list