[opencms-dev] flex: JSP and templates?
Alexander Kandzior
alex at opencms.org
Fri Aug 30 13:52:08 CEST 2002
Stefan,
> So there is no way to use a "normal" XML template for the JSP
> content pages?
No. The prefered way of building templates with JSP is like I have
already outlined.
> The reason I'm asking is this: we got a
> frametemplate for our whole website and so we'd like to be
> able to use this same frametemplate for our JSP content pages, too...
You can use <cms:include page="..."> with XML as an included page also.
You could try to manually edit the XML control file of a page and
add a JSP element as BODY element with the JSP launcher class as
provided below,
but I personally so far din't bother to try this out.
> Could the 2 approaches you've mentioned ("include page" /
> JSP-Templates defined in XML) be combined with frames / frame
> templates?
Probably. I din't try so far. Let me know if you succeed :)
Regarts,
Alex.
Alexander Kandzior
OpenCms Group / Alkacon Software
> > What we would need currently is to use a "standard"
> template for our
> > JSP content pages - is that possible in version 5 beta,
> too? Like if
> > you make a new JSP page in some content folder, assign a
> template to
> > it (just like to a standard HTML file)...?
>
> Try it like this:
>
> ------------------------
> <%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %>
>
> <cms:include page="demodefault_head.jsp" />
>
> Some HTML stuff.
>
> <cms:include page="demodefault_foot.jsp" />
> ------------------------
>
> Note: You can not use the WYSIWYG Editor on this pages.
> Use the XML approach show below for that.
> Oviously, the head / foot JSP files can be shared between XML and JSP.
>
> In case want you "assign" the target of the include with
> a property, this is unsupported in the 5.0 beta 1.
> Maybe it will make the final.
>
> Regards,
>
> Alex.
>
> Alexander Kandzior
> OpenCms Group / Alkacon Software
>
>
> > 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