blob: 5b4652a5fb44cef58528f2608fe0e55263cc1376 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Fri Aug 22 03:43:56 EDT 2003 -->
<TITLE>
org.apache.struts.taglib.template (Apache Struts API Documentation)
</TITLE>
<META NAME="keywords" CONTENT="org.apache.struts.taglib.template package">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">
</HEAD>
<SCRIPT>
function asd()
{
parent.document.title="org.apache.struts.taglib.template (Apache Struts API Documentation)";
}
</SCRIPT>
<BODY BGCOLOR="white" onload="asd();">
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_top"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-use.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../org/apache/struts/taglib/nested/logic/package-summary.html"><B>PREV PACKAGE</B></A>&nbsp;
&nbsp;<A HREF="../../../../../org/apache/struts/taglib/template/util/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html" TARGET="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="package-summary.html" TARGET="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;
<SCRIPT>
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
<H2>
Package org.apache.struts.taglib.template
</H2>
<b>Note:</b> As of Struts 1.1 the template tag library is
deprecated in favor of Tiles.
<P>
<B>See:</B>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="#package_description"><B>Description</B></A>
<P>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Class Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="GetTag.html">GetTag</A></B></TD>
<TD><B>Deprecated.</B>&nbsp;<I>Use Tiles instead.</I></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="InsertTag.html">InsertTag</A></B></TD>
<TD><B>Deprecated.</B>&nbsp;<I>Use Tiles instead.</I></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="PutTag.html">PutTag</A></B></TD>
<TD><B>Deprecated.</B>&nbsp;<I>Use Tiles instead.</I></TD>
</TR>
</TABLE>
&nbsp;
<P>
<A NAME="package_description"><!-- --></A><H2>
Package org.apache.struts.taglib.template Description
</H2>
<P>
<p>
<b>Note:</b> As of Struts 1.1 the template tag library is
deprecated in favor of Tiles.
</p>
<p> The "struts-template" tag library contains tags that are useful in
creating dynamic JSP templates for pages which share a common format.
These templates are best used when it is likely that a layout shared
by several pages in your application will change. The functionality provided
by these tags is similar to what can be achieved using standard JSP include
directive, but are dynamic rather than static. </p>
<a name="doc.Description"></a>
<p> </p>
<div align="Center"> <a href="#doc.Introduction">[Introduction]</a>
<a href="#doc.Functionality">[Template Functionality]</a>
<a href="#TagLib_Template_UML_">[Template UML]</a>
<a href="#doc.Properties">[Template Properties]</a>
<a href="#doc.Examples">[Template Examples]</a>
</div>
<p></p>
<hr /=""> <a name="doc.Intro"></a>
<h3>Introduction<a name="doc.Introduction"></a>
</h3>
<p> The Template library supplies tags that are useful for creating dynamic
JSP templates for pages which share a common format. </p>
<a name="doc.Functionality"></a>
<h3>Template Tag Functionality<a name="doc.Functionality"></a>
</h3>
<p>Each of the three template tags has a specific, interelated function:</p>
<p> </p>
<ul>
<li><b><a href="../../../../../../userGuide/struts-template.html#get">get</a>
</b> - Retrieves content from a request scope bean, for use in the template
layout.</li>
<li><b><a href="../../../../../../userGuide/struts-template.html#insert">insert</a>
</b> - Retrieves (or includes) the specified template file, and then
inserts the specified content into the template's layout. By changing the
layout defined in the template file, any other file that inserts the template
will automatically use the new layout.</li>
<li><b><a href="../../../../../../userGuide/struts-template.html#put">put</a>
</b> - Creates a request scope bean that specifies the content to be
used by the get tag. Content can be printed directly or included from a JSP
or HTML fil</li>
<li><br>
<br>
<br>
</li>
<li><a name="TagLib_Template_UML_"></a>
<img src="doc-files/template.gif" alt="TagLib Template UML">
</li>
</ul>
<p></p>
<h3>Template Tag Properties<a name="doc.Properties"></a>
</h3>
<p>The three template tags use very simple attributes :</p>
<blockquote>
<p><b>get</b> - Requires a single property, the name of the content to
be inserted. This tag is used in the template file to indicate where in the
layout to insert the content. This name matches the name property used by
a put tag.</p>
<p><b>insert</b> - Requires a single property, the name of the template.
This tag is the parent to one or more put tags. The put tags indicate the
content to be inserted into the template. The layout of the content is determined
by get tags placed in the template.</p>
<p><b>put</b> - Requires a name property, which should match a name used
in the template file. The content property indicates the source of the content.
The optional direct attribute indicates whether the content should be included
or printed directly (as a literal string). The default is false, meaning
content is included.</p>
<a name="doc.Examples"></a>
<h3>Template Tag Examples</h3>
<p align="Center"><b>A sample template file</b></p>
<blockquote>
<hr>
<pre>&lt;%@ taglib uri='/WEB-INF/tlds/struts-template.tld' prefix='template' %&gt;<br>&lt;html&gt;&lt;head&gt;&lt;title&gt;&lt;template:get name='title'/&gt;&lt;/title&gt;&lt;/head&gt;<br>&lt;body background='graphics/blueAndWhiteBackground.gif'&gt;<br>&lt;table&gt;<br> &lt;tr valign='top'&gt;&lt;td&gt;&lt;template:get name='sidebar'/&gt;&lt;/td&gt;<br> &lt;td&gt;&lt;table&gt;<br> &lt;tr&gt;&lt;td&gt;&lt;template:get name='header'/&gt;&lt;/td&gt;&lt;/tr&gt;<br> &lt;tr&gt;&lt;td&gt;&lt;template:get name='content'/&gt;&lt;/td&gt;&lt;/tr&gt;<br> &lt;tr&gt;&lt;td&gt;&lt;template:get name='footer'/&gt;&lt;/td&gt;&lt;/tr&gt;<br> &lt;/table&gt;<br> &lt;/td&gt;<br> &lt;/tr&gt;<br>&lt;/table&gt;<br>&lt;/body&gt;&lt;/html&gt;<br>&lt;%<br>/*<br>"chapterTemplate.jsp"<br>Display a "sidebar" in a column along the left side of the page.<br>Display a "header" over the right column.<br>Display the page "content" below the header.<br>Display a "footer" at below the content.<br>If we change the layout of the elements on this page, all pages<br>inserting this page will also change to use the new layout.<br>*/<br>%&gt;<br></pre>
<hr> </blockquote>
<p align="Center"><b>A sample JSP using the template</b></p>
<blockquote>
<hr>
<pre>&lt;%@ taglib uri='/WEB-INF/tlds/struts-template.tld' prefix='template' %&gt;<br>&lt;template:insert template='/chapterTemplate.jsp'&gt;<br> &lt;template:put name='title' content='Templates' direct='true'/&gt;<br> &lt;template:put name='header' content='/header.html' /&gt;<br> &lt;template:put name='sidebar' content='/sidebar.jsp' /&gt;<br> &lt;template:put name='content' content='/introduction.html'/&gt;<br> &lt;template:put name='footer' content='/footer.html' /&gt;<br>&lt;/template:insert&gt;<br>&lt;%<br>/*<br>"introduction.jsp"<br>Specify template for this page (chapterTemplate.jsp).<br>The chapterTemplate.jsp defines the layout positions for five<br>elements: title, header, sidebar, content, and footer.<br>Specify the source file (html or jsp) for each element.<br>*/<br>%&gt;<br></pre>
<hr> </blockquote>
<p align="Center"><b>A sample HTML content file ("header.html") used
by "introduction.jsp", and others.</b></p>
<blockquote>
<hr>
<pre>&lt;table&gt;<br>&lt;tr&gt;<br>&lt;td&gt;&lt;img src='graphics/java.gif'/&gt;&lt;/td&gt;<br>&lt;td&gt;&lt;img src='graphics/templates.gif'/&gt;&lt;/td&gt;<br>&lt;/tr&gt;<br>&lt;/table&gt;<br></pre>
<hr> </blockquote>
<p align="Center"><b>A sample JSP content file ("sidebar.jsp") used
by "introduction.jsp", and others.</b></p>
<blockquote>
<hr>
<pre>&lt;font size='5'&gt;&lt;a name="top"&gt;Topics&lt;/a&gt;&lt;/font&gt;&lt;p&gt;<br>&lt;table width='145'&gt;<br> &lt;tr&gt;&lt;td&gt;&lt;a href='introduction.jsp'&gt;<br> Introduction &lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;<br>
&lt;tr&gt;&lt;td&gt;&lt;a href='using.jsp'&gt;<br> Using Templates &lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;<br>
&lt;tr&gt;&lt;td&gt;&lt;a href='optional.jsp'&gt;<br> Optional Content &lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;<br> &lt;tr&gt;&lt;td&gt;&lt;a href='more.jsp'&gt;<br> ... and more ...&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;<br> &lt;/table&gt;&lt;/p&gt;<br>
&lt;%<br>/*<br>Specify navigational links for this application.<br>*/<br>%&gt;<br></pre>
<hr> </blockquote>
<p align="Center"><b>A sample HTML content file used by "introduction.jsp"
only.</b></p>
<blockquote>
<hr>
<pre>&lt;html&gt;<br>&lt;head&gt;<br>&lt;link rel="stylesheet" href="css/templates.css" <br>charset="ISO-8859-1" type="text/css"&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>&lt;h3 class="ChapTitle"&gt;Introduction&lt;/h3&gt;<br>&lt;p class="Paragraph"&gt;Window toolkits typically provide a layout mechanism<br>&lt; ... /&gt;<br><hr>
</pre>
</blockquote>
<!--
<h3>Optional Content</h3>
<p>All content is optional. If a source page does not specify the content for an element in the template, that element is simply ignored. This can make using templates more flexible, since you can use the same template for more than one page, simply by ommitting or specifying a content element. However, this feature also means that a misspelled name could lead the template to quietly ignore content you meant to include.</p>
-->
</blockquote>
<P>
<P>
<HR>
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-use.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../org/apache/struts/taglib/nested/logic/package-summary.html"><B>PREV PACKAGE</B></A>&nbsp;
&nbsp;<A HREF="../../../../../org/apache/struts/taglib/template/util/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html" TARGET="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="package-summary.html" TARGET="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;
<SCRIPT>
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
Copyright © 2000-2003 - Apache Software Foundation
</BODY>
</HTML>