This is an automated email from the ASF dual-hosted git repository. git-site-role pushed a commit to branch asf-site in repository https://gitbox.apache.org/repos/asf/struts-site.git
The following commit(s) were added to refs/heads/asf-site by this push: new 42619ec Updates production by Jenkins 42619ec is described below commit 42619eceeb22045fcfd24a18da5e3ce1f359bbfa Author: jenkins <bui...@apache.org> AuthorDate: Sat Sep 23 15:08:40 2017 +0000 Updates production by Jenkins --- content/tag-developers/extending-themes.html | 175 +++++--------- .../selecting-template-directory.html | 58 +---- content/tag-developers/selecting-themes.html | 63 ++--- content/tag-developers/tag-reference.html | 259 ++++++++++++++++++++- content/tag-developers/template-loading.html | 162 +++++-------- content/tag-developers/themes-and-templates.html | 24 +- content/tag-developers/ui-tags.html | 8 +- 7 files changed, 401 insertions(+), 348 deletions(-) diff --git a/content/tag-developers/extending-themes.html b/content/tag-developers/extending-themes.html index 7a807eb..bf93951 100644 --- a/content/tag-developers/extending-themes.html +++ b/content/tag-developers/extending-themes.html @@ -126,157 +126,98 @@ <article class="container"> <section class="col-md-12"> <a class="edit-on-gh" href="https://github.com/apache/struts-site/edit/master/source/tag-developers/extending-themes.md" title="Edit this page on GitHub">Edit on GitHub</a> - <h1 id="extending-themes">Extending Themes</h1> + <h1 class="no_toc" id="extending-themes">Extending Themes</h1> + +<ul id="markdown-toc"> + <li><a href="#creating-a-new-theme-from-scratch" id="markdown-toc-creating-a-new-theme-from-scratch">Creating a New Theme from Scratch</a></li> + <li><a href="#wrapping-an-existing-theme" id="markdown-toc-wrapping-an-existing-theme">Wrapping an Existing Theme</a> <ul> + <li><a href="#wrapping-a-control" id="markdown-toc-wrapping-a-control">Wrapping a control</a></li> + <li><a href="#extending-an-existing-theme" id="markdown-toc-extending-an-existing-theme">Extending an Existing Theme</a></li> + </ul> + </li> + <li><a href="#special-parameters" id="markdown-toc-special-parameters">Special parameters</a></li> +</ul> -<p>Most often, an application may just need to override a template (see <a href="#PAGE_13817">Template Loading</a>) so that a certain control renders differently. Or, an application may need to add a new template to an existing theme. Other times, you might want to create an entirely new theme, perhaps because you are building a rich set of unique and reusable templates for your organization.</p> +<p>Most often, an application may just need to override a template (see <a href="template-loading.html">Template Loading</a>) so that +a certain control renders differently. Or, an application may need to add a new template to an existing theme. Other +times, you might want to create an entirely new theme, perhaps because you are building a rich set of unique and reusable +templates for your organization.</p> <p>There are three ways to create new themes:</p> <ul> - <li> - <p>Create a new theme from scratch (<strong>hard!</strong>)</p> - </li> - <li> - <p>Wrap an existing theme</p> - </li> - <li> - <p>Extend an existing theme</p> - </li> + <li>Create a new theme from scratch (<strong>hard!</strong>)</li> + <li>Wrap an existing theme</li> + <li>Extend an existing theme</li> </ul> -<p><strong>Creating a New Theme from Scratch</strong></p> - -<p>It’s probably never a good idea to create a new theme from scratch. Instead, use the <a href="#PAGE_14291">simple theme</a> as a starting point. The simple theme provides just enough foundation to make it easy to create new controls by extending or wrapping the basic controls. Before starting a new theme, be sure to review the source templates for all of the provided themes. The existing themes are your best guide to creating new themes.</p> +<h2 id="creating-a-new-theme-from-scratch">Creating a New Theme from Scratch</h2> -<table> - <tbody> - <tr> - </tr> - </tbody> -</table> +<p>It’s probably never a good idea to create a new theme from scratch. Instead, use the <a href="simple-theme.html">simple theme</a> +as a starting point. The simple theme provides just enough foundation to make it easy to create new controls by extending +or wrapping the basic controls. Before starting a new theme, be sure to review the source templates for all of the provided +themes. The existing themes are your best guide to creating new themes.</p> -<p><strong>Wrapping an Existing Theme</strong></p> +<h2 id="wrapping-an-existing-theme">Wrapping an Existing Theme</h2> -<p>The <a href="#PAGE_13834">xhtml theme</a> provides several good examples of the “wrapping” technique. The <a href="#PAGE_14291">simple theme</a> renders the basic control. The xhtml theme “dresses up” many of the controls by adding a header and footer.</p> +<p>The <a href="xhtml-theme.html">xhtml theme</a> provides several good examples of the “wrapping” technique. +The <a href="simple-theme.html">simple theme</a> renders the basic control. The xhtml theme “dresses up” many of the controls +by adding a header and footer.</p> -<p><strong>Wrapping a control</strong></p> - -<div class="highlighter-rouge"><pre class="highlight"><code><#include "/${parameters.templateDir}/${parameters.expandTheme}/controlheader.ftl" /> -<#include "/${parameters.templateDir}/simple/xxx.ftl" /> -<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlfooter.ftl" /> +<h3 id="wrapping-a-control">Wrapping a control</h3> +<div class="highlighter-rouge"><pre class="highlight"><code><span class="err"><</span>#include "/${parameters.templateDir}/${parameters.expandTheme}/controlheader.ftl" /> +<span class="err"><</span>#include "/${parameters.templateDir}/simple/xxx.ftl" /> +<span class="err"><</span>#include "/${parameters.templateDir}/${parameters.expandTheme}/controlfooter.ftl" /> </code></pre> </div> <p>Wrapping is a great way to augment the basic HTML elements provided by the simple theme.</p> -<p><strong>Extending an Existing Theme</strong></p> +<h3 id="extending-an-existing-theme">Extending an Existing Theme</h3> -<p>One benefit of object-orientated programming is that it lets us “design by difference.” We can extend an object and code only the behaviour that changes. Themes provide a similar capability. The subdirectory that hosts a theme can contain a</p> - -<div class="highlighter-rouge"><pre class="highlight"><code>theme.properties -</code></pre> -</div> -<p>file. A</p> - -<div class="highlighter-rouge"><pre class="highlight"><code>parent -</code></pre> -</div> -<p>entry can be added to the property file to designate a theme to extend. The <a href="#PAGE_14205">ajax theme</a> extends the <a href="#PAGE_13834">xhtml theme</a> using this technique.</p> +<p>One benefit of object-orientated programming is that it lets us “design by difference.” We can extend an object and code +only the behaviour that changes. Themes provide a similar capability. The subdirectory that hosts a theme can contain +a <code class="highlighter-rouge">theme.properties</code> file. A <code class="highlighter-rouge">parent</code> entry can be added to the property file to designate a theme to extend. +The <a href="ajax-theme.html">ajax theme</a> extends the <a href="xhtml-theme.html">xhtml theme</a> using this technique.</p> <p><strong>/template/ajax/theme.properties</strong></p> <div class="highlighter-rouge"><pre class="highlight"><code>parent = xhtml - -</code></pre> -</div> - -<p>An extended theme does not need to implement every single template that the <a href="#PAGE_14248">Struts Tags</a> expect. It only needs to implement the templates that change. The other templates are loaded from the parent template.</p> - -<p><strong>Special parameters</strong></p> - -<p><a href="http://struts.apache.org/development/2.x/struts2-core/apidocs/org/apache/struts2/components/UIBean.html">UIBean</a>^[http://struts.apache.org/development/2.x/struts2-core/apidocs/org/apache/struts2/components/UIBean.html] provides few special parameters which can be used to build a new template (they are already used in</p> - -<div class="highlighter-rouge"><pre class="highlight"><code>xhtml -</code></pre> -</div> -<p>and</p> - -<div class="highlighter-rouge"><pre class="highlight"><code>css_xhtml -</code></pre> -</div> -<p>theme):</p> - -<ul> - <li></li> -</ul> - -<div class="highlighter-rouge"><pre class="highlight"><code>templateDir </code></pre> </div> -<ul> - <li> - <p>current value of templateDir parameter, see <a href="#PAGE_14227">Selecting Template Directory</a></p> - </li> - <li></li> -</ul> -<div class="highlighter-rouge"><pre class="highlight"><code>theme -</code></pre> -</div> -<ul> - <li> - <p>used theme, see <a href="#PAGE_14016">Selecting Themes</a></p> - </li> - <li></li> -</ul> +<p>An extended theme does not need to implement every single template that the <a href="struts-tags.html">Struts Tags</a> expect. +It only needs to implement the templates that change. The other templates are loaded from the parent template.</p> -<div class="highlighter-rouge"><pre class="highlight"><code>template -</code></pre> -</div> -<ul> - <li> - <p>name of the template file to use (i.e. text)</p> - </li> - <li></li> -</ul> +<h2 id="special-parameters">Special parameters</h2> -<div class="highlighter-rouge"><pre class="highlight"><code>themeExpansionToken -</code></pre> -</div> -<ul> - <li>special token used to indicate to search for a template also in parent theme (when used with</li> -</ul> - -<div class="highlighter-rouge"><pre class="highlight"><code><#include /> -</code></pre> -</div> -<p>directive)</p> - -<ul> - <li></li> -</ul> +<p><a href="http://struts.apache.org/maven/struts2-core/apidocs/org/apache/struts2/components/UIBean.html">UIBean</a> provides few +special parameters which can be used to build a new template (they are already used in <code class="highlighter-rouge">xhtml</code> and <code class="highlighter-rouge">css_xhtml</code> theme):</p> -<div class="highlighter-rouge"><pre class="highlight"><code>expandTheme -</code></pre> -</div> <ul> - <li>tells internal template loader mechanism to try load template from current theme and then from parent theme (and parent theme, and so on)</li> + <li><code class="highlighter-rouge">templateDir</code> - current value of templateDir parameter, see <a href="selecting-template-directory.html">Selecting Template Directory</a></li> + <li><code class="highlighter-rouge">theme</code> - used theme, see <a href="selecting-themes.html">Selecting Themes</a></li> + <li><code class="highlighter-rouge">template</code> - name of the template file to use (i.e. text)</li> + <li><code class="highlighter-rouge">themeExpansionToken</code> - a special token used to indicate to search for a template also in parent theme (when used with +<code class="highlighter-rouge"><#include /></code> directive)</li> + <li><code class="highlighter-rouge">expandTheme</code> - tells internal template loader mechanism to try load template from current theme and then from parent +theme (and parent theme, and so on)</li> </ul> -<p>Using</p> - -<div class="highlighter-rouge"><pre class="highlight"><code>expandTheme -</code></pre> -</div> -<p>parameter allows to override only some parts of the theme’s templates, e.g. css.ftl. You can define a new theme (set theme.properties) and override just single file.</p> - -<p>${parameters.expandTheme} is a recurrence which tells ThemeManager to load template from current theme and then from parent theme (defined in theme.properties) and so on.</p> +<p>Using <code class="highlighter-rouge">expandTheme</code> parameter allows to override only some parts of the theme’s templates, e.g. <code class="highlighter-rouge">css.ftl</code>. You can +define a new theme (set <code class="highlighter-rouge">theme.properties</code>) and override just single file.</p> -<p>Please also notice that the ThemeManager builds list of possible templates based on current theme and inherited themes (/template/custom/textarea.ftl, /template/xhtml/textarea.ftl, /template/simple/textarea.ftl). This is also true for templates which are loaded via ${parameters.expandTheme}.</p> +<p><code class="highlighter-rouge">${parameters.expandTheme}</code> is a recurrence which tells <code class="highlighter-rouge">ThemeManager</code> to load template from current theme and then +from parent theme (defined in <code class="highlighter-rouge">theme.properties</code>) and so on.</p> -<p>(ok) See also example <em>Struts 2 Themes</em> or <a href="http://www.vitarara.org/cms/struts_2_cookbook/creating_a_theme">Creating a Theme in Struts 2</a>^[http://www.vitarara.org/cms/struts_2_cookbook/creating_a_theme] (Mark Menard)</p> +<p>Please also notice that the <code class="highlighter-rouge">ThemeManager</code> builds list of possible templates based on current theme and inherited +themes (<code class="highlighter-rouge">/template/custom/textarea.ftl</code>, <code class="highlighter-rouge">/template/xhtml/textarea.ftl</code>, <code class="highlighter-rouge">/template/simple/textarea.ftl</code>). This is also +true for templates which are loaded via <code class="highlighter-rouge">${parameters.expandTheme}</code>.</p> +<blockquote> + <p>See also example <a href="">Struts 2 Themes</a> or <a href="http://www.vitarara.org/cms/struts_2_cookbook/creating_a_theme">Creating a Theme in Struts 2</a> (Mark Menard)</p> +</blockquote> </section> </article> diff --git a/content/tag-developers/selecting-template-directory.html b/content/tag-developers/selecting-template-directory.html index 1961137..09eeddc 100644 --- a/content/tag-developers/selecting-template-directory.html +++ b/content/tag-developers/selecting-template-directory.html @@ -131,62 +131,20 @@ <p>Template directory can be selected using several different rules, in this order:</p> <ol> - <li>The</li> + <li>The <code class="highlighter-rouge">templateDir</code> attribute on the specific tag</li> + <li>The page-scoped attribute named <code class="highlighter-rouge">templateDir</code></li> + <li>The request-scoped attribute named <code class="highlighter-rouge">templateDir</code></li> + <li>The session-scoped attribute named <code class="highlighter-rouge">templateDir</code></li> + <li>The application-scoped attribute named <code class="highlighter-rouge">templateDir</code></li> + <li>The <code class="highlighter-rouge">struts.ui.templateDir</code> property in <code class="highlighter-rouge">struts.xml</code> (defaults to <em>template</em>)</li> </ol> -<div class="highlighter-rouge"><pre class="highlight"><code>templateDir -</code></pre> -</div> -<p>attribute on the specific tag</p> - -<ol> - <li>The page-scoped attribute named</li> -</ol> - -<div class="highlighter-rouge"><pre class="highlight"><code>templateDir -</code></pre> -</div> - -<ol> - <li>The request-scoped attribute named</li> -</ol> - -<div class="highlighter-rouge"><pre class="highlight"><code>templateDir -</code></pre> -</div> - -<ol> - <li>The session-scoped attribute named</li> -</ol> - -<div class="highlighter-rouge"><pre class="highlight"><code>templateDir -</code></pre> -</div> - -<ol> - <li>The application-scoped attribute named</li> -</ol> - -<div class="highlighter-rouge"><pre class="highlight"><code>templateDir -</code></pre> -</div> - -<ol> - <li>The</li> -</ol> - -<div class="highlighter-rouge"><pre class="highlight"><code>struts.ui.templateDir -</code></pre> -</div> -<p>property in <em>struts.properties</em> (defaults to <em>template</em> )</p> - -<p><strong>Tips</strong></p> +<h2 id="tips">Tips</h2> <ul> - <li>To change the template directory for the entire application, modify the <em>struts.properties</em> .</li> + <li>To change the template directory for the entire application, modify the <code class="highlighter-rouge">struts.xml</code></li> </ul> - </section> </article> diff --git a/content/tag-developers/selecting-themes.html b/content/tag-developers/selecting-themes.html index 3bd1607..986eec5 100644 --- a/content/tag-developers/selecting-themes.html +++ b/content/tag-developers/selecting-themes.html @@ -131,63 +131,26 @@ <p>Themes can be selected using several different rules, in this order:</p> <ol> - <li>The</li> + <li>The <code class="highlighter-rouge">theme</code> attribute on the specific tag</li> + <li>The <code class="highlighter-rouge">theme</code> attribute on a tag’s surrounding <a href="form-tag.html">form</a> tag</li> + <li>The page-scoped attribute named <code class="highlighter-rouge">theme</code></li> + <li>The request-scoped attribute named <code class="highlighter-rouge">theme</code></li> + <li>The session-scoped attribute named <code class="highlighter-rouge">theme</code></li> + <li>The application-scoped attribute named <code class="highlighter-rouge">theme</code></li> + <li>The <code class="highlighter-rouge">struts.ui.theme</code> property in <code class="highlighter-rouge">struts.xml</code> (defaults to <em>xhtml</em>)</li> </ol> -<div class="highlighter-rouge"><pre class="highlight"><code>theme -</code></pre> -</div> -<p>attribute on the specific tag</p> +<p>See <a href="">Can I change theme on a per-page basis</a> page for using scoped <code class="highlighter-rouge">theme</code> attribute.</p> -<ol> - <li>The</li> -</ol> - -<div class="highlighter-rouge"><pre class="highlight"><code>theme -</code></pre> -</div> -<p>attribute on a tag’s surrounding <a href="#PAGE_14201">form</a> tag</p> - -<ol> - <li> - <p>The page-scoped attribute named “theme”</p> - </li> - <li> - <p>The request-scoped attribute named “theme”</p> - </li> - <li> - <p>The session-scoped attribute named “theme”</p> - </li> - <li> - <p>The application-scoped attribute named “theme”</p> - </li> - <li> - <p>The</p> - </li> -</ol> - -<div class="highlighter-rouge"><pre class="highlight"><code>struts.ui.theme -</code></pre> -</div> -<p>property in <em>struts.properties</em> (defaults to <em>xhtml</em> )</p> - -<p>See “<em>Can I change theme on a per-page basis</em> “ page for using scoped “theme” attribute.</p> - -<p><strong>Tips</strong></p> +<h2 id="tips">Tips</h2> <ul> - <li> - <p>To override an entire form’s theme, change the “theme” attribute of the form. (Convenient for using the <a href="#PAGE_14205">ajax theme</a> for specific forms, for example.)</p> - </li> - <li> - <p>To support user-selected themes, set the theme in the user’s session.</p> - </li> - <li> - <p>To change the theme for the entire application, modify the <em>struts.properties</em> .</p> - </li> + <li>To override an entire form’s theme, change the “theme” attribute of the form. (Convenient for using +the <a href="ajax-theme.html">ajax theme</a> for specific forms, for example.)</li> + <li>To support user-selected themes, set the theme in the user’s session.</li> + <li>To change the theme for the entire application, modify the <code class="highlighter-rouge">struts.xml</code>.</li> </ul> - </section> </article> diff --git a/content/tag-developers/tag-reference.html b/content/tag-developers/tag-reference.html index 11815b9..811a021 100644 --- a/content/tag-developers/tag-reference.html +++ b/content/tag-developers/tag-reference.html @@ -126,12 +126,265 @@ <article class="container"> <section class="col-md-12"> <a class="edit-on-gh" href="https://github.com/apache/struts-site/edit/master/source/tag-developers/tag-reference.md" title="Edit this page on GitHub">Edit on GitHub</a> - <h1 id="tag-reference">Tag Reference</h1> + <h1 class="no_toc" id="tag-reference">Tag Reference</h1> -<p><a href="generic-tags.html">Generic Tags</a></p> +<ul id="markdown-toc"> + <li><a href="#generic-tags" id="markdown-toc-generic-tags">Generic Tags</a></li> + <li><a href="#ui-tag-reference" id="markdown-toc-ui-tag-reference">UI Tag Reference</a></li> +</ul> -<p><a href="ui-tags.html">UI Tags</a></p> +<p>Generic tags are used for controlling the execution flow when the pages render. These tags also allow for data extraction +from places other than your action or the value stack, such as <em>Localization</em> , JavaBeans, and including additional URLs +or action executions.</p> +<ul> + <li>Control Tags provide control flow, such as <code class="highlighter-rouge">if</code>, <code class="highlighter-rouge">else</code>, and <code class="highlighter-rouge">iterator</code></li> + <li>Data Tags allow for data manipulation or creation, such as <code class="highlighter-rouge">bean</code>, <code class="highlighter-rouge">push</code>, and <code class="highlighter-rouge">i18n</code></li> +</ul> + +<blockquote> + <p>Please make sure you have read the <a href="tag-syntax.html">Tag Syntax</a> document and understand how tag attribute syntax works.</p> +</blockquote> + +<h2 id="generic-tags">Generic Tags</h2> + +<p>Struts Generic Tags control the execution flow as pages render.</p> + +<table> + <tbody> + <tr> + <td><strong>Control Tags</strong></td> + <td> </td> + <td><strong>Data Tags</strong></td> + <td> </td> + </tr> + <tr> + <td> </td> + <td><a href="if-tag.html">if</a></td> + <td> </td> + <td><a href="a-tag.html">a</a></td> + </tr> + <tr> + <td> </td> + <td><a href="elseif-tag.html">elseif</a></td> + <td> </td> + <td><a href="action-tag.html">action</a></td> + </tr> + <tr> + <td> </td> + <td><a href="else-tag.html">else</a></td> + <td> </td> + <td><a href="bean-tag.html">bean</a></td> + </tr> + <tr> + <td> </td> + <td><a href="append-tag.html">append</a></td> + <td> </td> + <td><a href="date-tag.html">date</a></td> + </tr> + <tr> + <td> </td> + <td><a href="generator-tag.html">generator</a></td> + <td> </td> + <td><a href="debug-tag.html">debug</a></td> + </tr> + <tr> + <td> </td> + <td><a href="iterator-tag.html">iterator</a></td> + <td> </td> + <td><a href="i18n-tag.html">i18n</a></td> + </tr> + <tr> + <td> </td> + <td><a href="merge-tag.html">merge</a></td> + <td> </td> + <td><a href="include-tag.html">include</a></td> + </tr> + <tr> + <td> </td> + <td><a href="sort-tag.html">sort</a></td> + <td> </td> + <td><a href="param-tag.html">param</a></td> + </tr> + <tr> + <td> </td> + <td><a href="subset-tag.html">subset</a></td> + <td> </td> + <td><a href="property-tag.html">property</a></td> + </tr> + <tr> + <td> </td> + <td> </td> + <td> </td> + <td><a href="push-tag.html">push</a></td> + </tr> + <tr> + <td> </td> + <td> </td> + <td> </td> + <td><a href="set-tag.html">set</a></td> + </tr> + <tr> + <td> </td> + <td> </td> + <td> </td> + <td><a href="text-tag.html">text</a></td> + </tr> + <tr> + <td> </td> + <td> </td> + <td> </td> + <td><a href="url-tag.html">url</a></td> + </tr> + </tbody> +</table> + +<h2 id="ui-tag-reference">UI Tag Reference</h2> + +<p>Struts UI Tags display data in rich and reusable HTML.</p> + +<table> + <tbody> + <tr> + <td><strong>Form Tags</strong></td> + <td> </td> + <td><strong>Non-Form UI Tags</strong></td> + <td> </td> + </tr> + <tr> + <td> </td> + <td><a href="checkbox-tag.html">checkbox</a></td> + <td> </td> + <td><a href="actionerror-tag.html">actionerror</a></td> + </tr> + <tr> + <td> </td> + <td><a href="checkboxlist-tag.html">checkboxlist</a></td> + <td> </td> + <td><a href="actionmessage-tag.html">actionmessage</a></td> + </tr> + <tr> + <td> </td> + <td><a href="combobox-tag.html">combobox</a></td> + <td> </td> + <td><a href="component-tag.html">component</a></td> + </tr> + <tr> + <td> </td> + <td><a href="datetextfield-tag.html">datetextfield</a></td> + <td> </td> + <td><a href="div-tag.html">div</a></td> + </tr> + <tr> + <td> </td> + <td><a href="doubleselect-tag.html">doubleselect</a></td> + <td> </td> + <td><a href="fielderror-tag.html">fielderror</a></td> + </tr> + <tr> + <td> </td> + <td><a href="head-tag.html">head</a></td> + <td> </td> + <td> </td> + </tr> + <tr> + <td> </td> + <td><a href="file-tag.html">file</a></td> + <td> </td> + <td> </td> + </tr> + <tr> + <td> </td> + <td><a href="form-tag.html">form</a></td> + <td> </td> + <td> </td> + </tr> + <tr> + <td> </td> + <td><a href="hidden-tag.html">hidden</a></td> + <td> </td> + <td> </td> + </tr> + <tr> + <td> </td> + <td><a href="inputtransferselect-tag.html">inputtransferselect</a></td> + <td> </td> + <td> </td> + </tr> + <tr> + <td> </td> + <td><a href="label-tag.html">label</a></td> + <td> </td> + <td> </td> + </tr> + <tr> + <td> </td> + <td><a href="optiontransferselect-tag.html">optiontransferselect</a></td> + <td> </td> + <td> </td> + </tr> + <tr> + <td> </td> + <td><a href="optgroup-tag.html">optgroup</a></td> + <td> </td> + <td> </td> + </tr> + <tr> + <td> </td> + <td><a href="password-tag.html">password</a></td> + <td> </td> + <td> </td> + </tr> + <tr> + <td> </td> + <td><a href="radio-tag.html">radio</a></td> + <td> </td> + <td> </td> + </tr> + <tr> + <td> </td> + <td><a href="reset-tag.html">reset</a></td> + <td> </td> + <td> </td> + </tr> + <tr> + <td> </td> + <td><a href="select-tag.html">select</a></td> + <td> </td> + <td> </td> + </tr> + <tr> + <td> </td> + <td><a href="submit-tag.html">submit</a></td> + <td> </td> + <td> </td> + </tr> + <tr> + <td> </td> + <td><a href="textarea-tag.html">textarea</a></td> + <td> </td> + <td> </td> + </tr> + <tr> + <td> </td> + <td><a href="textfield-tag.html">textfield</a></td> + <td> </td> + <td> </td> + </tr> + <tr> + <td> </td> + <td><a href="token-tag.html">token</a></td> + <td> </td> + <td> </td> + </tr> + <tr> + <td> </td> + <td><a href="updownselect-tag.html">updownselect</a></td> + <td> </td> + <td> </td> + </tr> + </tbody> +</table> </section> </article> diff --git a/content/tag-developers/template-loading.html b/content/tag-developers/template-loading.html index 147d73e..8a1b864 100644 --- a/content/tag-developers/template-loading.html +++ b/content/tag-developers/template-loading.html @@ -126,159 +126,105 @@ <article class="container"> <section class="col-md-12"> <a class="edit-on-gh" href="https://github.com/apache/struts-site/edit/master/source/tag-developers/template-loading.md" title="Edit this page on GitHub">Edit on GitHub</a> - <h1 id="template-loading">Template Loading</h1> + <h1 class="no_toc" id="template-loading">Template Loading</h1> -<p>Templates are loaded first by searching the application and then by searching the classpath. If a template needs to be overridden, an edited copy can be placed in the application, so that is found first.</p> +<ul id="markdown-toc"> + <li><a href="#template-and-themes" id="markdown-toc-template-and-themes">Template and Themes</a></li> + <li><a href="#overriding-templates" id="markdown-toc-overriding-templates">Overriding Templates</a></li> + <li><a href="#altering-template-loading-behaviour" id="markdown-toc-altering-template-loading-behaviour">Altering Template Loading Behaviour</a></li> + <li><a href="#alternative-template-engines" id="markdown-toc-alternative-template-engines">Alternative Template Engines</a></li> +</ul> -<p><strong>(i) One for all</strong></p> +<p>Templates are loaded first by searching the application and then by searching the classpath. If a template needs to be +overridden, an edited copy can be placed in the application, so that is found first.</p> -<blockquote> - -</blockquote> - -<blockquote> - -</blockquote> +<p><strong>One for all</strong></p> <blockquote> - <p>FreeMarker is the default templating engine. The FreeMarker templates are used regardless of what format the view may use. Internally, the JSP, FTL, Velocity tags are all rendered using FreeMarker.</p> + <p>FreeMarker is the default templating engine. The FreeMarker templates are used regardless of what format the view may +use. Internally, the JSP, FTL, Velocity tags are all rendered using FreeMarker.</p> </blockquote> -<blockquote> - -</blockquote> - -<p><strong>Template and Themes</strong></p> - -<p>Templates are loaded based the template directory and theme name (see <a href="#PAGE_14016">Selecting Themes</a>). The template directory is defined by the</p> - -<div class="highlighter-rouge"><pre class="highlight"><code>struts.ui.templateDir -</code></pre> -</div> -<p>property in <em>struts.properties</em> (defaults to</p> - -<div class="highlighter-rouge"><pre class="highlight"><code>template -</code></pre> -</div> -<p>). If a tag is using the</p> +<h2 id="template-and-themes">Template and Themes</h2> -<div class="highlighter-rouge"><pre class="highlight"><code>xhtml -</code></pre> -</div> -<p>theme, the following two locations will be searched (in this order):</p> +<p>Templates are loaded based the template directory and theme name (see <a href="selecting-themes.html">Selecting Themes</a>). +The template directory is defined by the <code class="highlighter-rouge">struts.ui.templateDir</code> property in <code class="highlighter-rouge">struts.xml</code> (defaults to <code class="highlighter-rouge">template</code>). +If a tag is using the <code class="highlighter-rouge">xhtml</code> theme, the following two locations will be searched (in this order):</p> <table> - <thead> + <tbody> <tr> - <th>In the application</th> - <th>/template/xhtml/template.ftl</th> + <td>In the application</td> + <td><code class="highlighter-rouge">/template/xhtml/template.ftl</code></td> </tr> - </thead> - <tbody> <tr> <td>In the classpath</td> - <td>/template/xhtml/template.ftl</td> + <td><code class="highlighter-rouge">/template/xhtml/template.ftl</code></td> </tr> </tbody> </table> -<p>(!) For performance reasons, you may want to prefer the first location, although the second one is more flexible. See <em>Performance Tuning</em> for a discussion on this topic.</p> - -<p><strong>Overriding Templates</strong></p> - -<p>The default templates provided in the</p> - -<div class="highlighter-rouge"><pre class="highlight"><code>struts-core.jar -</code></pre> -</div> -<p>should suit the needs of many applications. However, if a template needs to be modified, it’s easy to plug in a new version. Extract the template you need to change from the</p> - -<div class="highlighter-rouge"><pre class="highlight"><code>struts-core.jar -</code></pre> -</div> -<p>, make the modifications, and save the updated copy to</p> - -<div class="highlighter-rouge"><pre class="highlight"><code>/template/$theme/$template.ftl -</code></pre> -</div> -<p>. If you are using the xhmtl theme and need to change how the select tags render, edit that template and save it to</p> - -<div class="highlighter-rouge"><pre class="highlight"><code>/template/xhtml/select.ftl -</code></pre> -</div> -<p>.</p> +<blockquote> + <p>For performance reasons, you may want to prefer the first location, although the second one is more flexible. +See <a href="../core-developers/performance-tuning.html">Performance Tuning</a> for a discussion on this topic.</p> +</blockquote> -<p>(!) It is easier and better to edit and override an existing template than provide a new one of your own.</p> +<h2 id="overriding-templates">Overriding Templates</h2> -<p><strong>Altering Template Loading Behaviour</strong></p> +<p>The default templates provided in the <code class="highlighter-rouge">struts2-core.jar</code> should suit the needs of many applications. However, +if a template needs to be modified, it’s easy to plug in a new version. Extract the template you need to change from +the <code class="highlighter-rouge">struts2-core.jar</code>, make the modifications, and save the updated copy to <code class="highlighter-rouge">/template/$theme/$template.ftl</code>. +If you are using the <code class="highlighter-rouge">xhtml</code> theme and need to change how the select tags render, edit that template and save it to +<code class="highlighter-rouge">/template/xhtml/select.ftl</code>.</p> -<p>It is possible to load template from other locations, like the file system or a URL. Loading templates from alternate locations can be useful not only for tags, but for custom results. For details, see the <a href="#PAGE_14078">FreeMarker</a> documentation and consult the section on extending the FreeMarkerManager.</p> +<blockquote> + <p>It is easier and better to edit and override an existing template than provide a new one of your own.</p> +</blockquote> -<p><strong>Alternative Template Engines</strong></p> +<h2 id="altering-template-loading-behaviour">Altering Template Loading Behaviour</h2> -<p>The framework provides for template rendering engines other than FreeMarker. (Though, there is rarely a need to use another system!)</p> +<p>It is possible to load template from other locations, like the file system or a URL. Loading templates from alternate +locations can be useful not only for tags, but for custom results. For details, see the <a href="freemarker.html">FreeMarker</a> +documentation and consult the section on extending the FreeMarkerManager.</p> -<p><strong>(!) Don’t try this at home!</strong></p> +<h2 id="alternative-template-engines">Alternative Template Engines</h2> -<blockquote> +<p>The framework provides for template rendering engines other than FreeMarker. (Though, there is rarely a need to use +another system!)</p> -</blockquote> - -<blockquote> - -</blockquote> +<p><strong>Don’t try this at home!</strong></p> <blockquote> <p>Alternative template engines are best left to advanced users with special needs!</p> </blockquote> -<blockquote> - -</blockquote> - -<p>The framework supports three template engines, which can be controlled by the</p> - -<div class="highlighter-rouge"><pre class="highlight"><code>struts.ui.templateSuffix -</code></pre> -</div> -<p>in <em>struts.properties</em> .</p> +<p>The framework supports three template engines, which can be controlled by the <code class="highlighter-rouge">struts.ui.templateSuffix</code> in +<code class="highlighter-rouge">struts.xml</code>.</p> <table> - <thead> + <tbody> <tr> - <th>ftl (default)</th> - <th><a href="#PAGE_14078">FreeMarker</a>-based template engine</th> + <td>ftl (default)</td> + <td><a href="freemarker.html">FreeMarker</a>-based template engine</td> </tr> - </thead> - <tbody> <tr> <td>vm</td> - <td><a href="#PAGE_13894">Velocity</a>-based template engine</td> + <td><a href="velocity.html">Velocity</a>-based template engine</td> </tr> <tr> <td>jsp</td> - <td><a href="#PAGE_14141">JSP</a>-based template engine</td> + <td><a href="jsp.html">JSP</a>-based template engine</td> </tr> </tbody> </table> -<p>The only set of templates and themes provided in the distribution is for FreeMarker. In order to use another template engine, you must provide your own template and theme for that engine.</p> - -<table> - <tbody> - <tr> - <td>Don’t feel that you need to rewrite the templates to match your view format. If you need to customize the template, try copying and modifying the FreeMarker template first. Most changes should be obvious.</td> - </tr> - </tbody> -</table> - -<table> - <tbody> - <tr> - </tr> - </tbody> -</table> +<p>The only set of templates and themes provided in the distribution is for FreeMarker. In order to use another template +engine, you must provide your own template and theme for that engine.</p> +<blockquote> + <p>Don’t feel that you need to rewrite the templates to match your view format. If you need to customize the template, +try copying and modifying the FreeMarker template first. Most changes should be obvious.</p> +</blockquote> </section> </article> diff --git a/content/tag-developers/themes-and-templates.html b/content/tag-developers/themes-and-templates.html index 7e52b7f..15d8b39 100644 --- a/content/tag-developers/themes-and-templates.html +++ b/content/tag-developers/themes-and-templates.html @@ -133,13 +133,11 @@ <h2 id="definitions">Definitions</h2> <table> - <thead> + <tbody> <tr> - <th>tag</th> - <th>A small piece of code executed from within <a href="jsp.html">JSP</a>, <a href="freemarker.html">FreeMarker</a>, or <a href="velocity.html">Velocity</a>.</th> + <td>tag</td> + <td>A small piece of code executed from within <a href="jsp.html">JSP</a>, <a href="freemarker.html">FreeMarker</a>, or <a href="velocity.html">Velocity</a>.</td> </tr> - </thead> - <tbody> <tr> <td>template</td> <td>A bit of code, usually written in <a href="freemarker.html">FreeMarker</a>, that can be rendered by certain tags (HTML tags)</td> @@ -158,13 +156,11 @@ <h2 id="template-basics">Template Basics</h2> <table> - <thead> + <tbody> <tr> - <th><a href="template-loading.html">Template Loading</a></th> - <th>How templates are loaded</th> + <td><a href="template-loading.html">Template Loading</a></td> + <td>How templates are loaded</td> </tr> - </thead> - <tbody> <tr> <td><a href="selecting-template-directory.html">Selecting Template Directory</a></td> <td>How the template directories are loaded</td> @@ -183,13 +179,11 @@ <h2 id="more-about-themes">More About Themes</h2> <table> - <thead> + <tbody> <tr> - <th><a href="simple-theme.html">simple theme</a></th> - <th>A minimal theme with no “bells and whistles”</th> + <td><a href="simple-theme.html">simple theme</a></td> + <td>A minimal theme with no “bells and whistles”</td> </tr> - </thead> - <tbody> <tr> <td><a href="xhtml-theme.html">xhtml theme</a></td> <td>The default theme that uses common HTML practices</td> diff --git a/content/tag-developers/ui-tags.html b/content/tag-developers/ui-tags.html index 80de451..411d74e 100644 --- a/content/tag-developers/ui-tags.html +++ b/content/tag-developers/ui-tags.html @@ -137,13 +137,11 @@ is any content to output), the UI tags defer to a template, often grouped togeth requirements. For details, see <a href="themes-and-templates.html">Themes and Templates</a>.</p> <table> - <thead> + <tbody> <tr> - <th><a href="themes-and-templates.html">Themes and Templates</a></th> - <th>A must-read explanation of how themes and templates are used when rendering UI tags.</th> + <td><a href="themes-and-templates.html">Themes and Templates</a></td> + <td>A must-read explanation of how themes and templates are used when rendering UI tags.</td> </tr> - </thead> - <tbody> <tr> <td><a href="form-tags.html">Form Tags</a></td> <td>provide all form-related UI output, such as <em>form</em> , <em>textfield</em> , and <em>select</em> .</td> -- To stop receiving notification emails like this one, please contact ['"commits@struts.apache.org" <commits@struts.apache.org>'].