This is an automated email from the ASF dual-hosted git repository.
git-site-role pushed a commit to branch asf-staging
in repository https://gitbox.apache.org/repos/asf/struts-site.git
The following commit(s) were added to refs/heads/asf-staging by this push:
new 1c9925a4b Updates stage by Jenkins
1c9925a4b is described below
commit 1c9925a4b618a4141dad46974de59748628000a9
Author: jenkins <[email protected]>
AuthorDate: Sun Dec 14 18:47:31 2025 +0000
Updates stage by Jenkins
---
content/getting-started/themes.html | 10 +-
...{themes-and-templates.html => html5-theme.html} | 210 +++++++++++++--------
content/tag-developers/themes-and-templates.html | 4 +
3 files changed, 144 insertions(+), 80 deletions(-)
diff --git a/content/getting-started/themes.html
b/content/getting-started/themes.html
index a0261066e..c696537c8 100644
--- a/content/getting-started/themes.html
+++ b/content/getting-started/themes.html
@@ -167,7 +167,7 @@
<p>When you use a Struts tag such as <code class="language-plaintext
highlighter-rouge">s:select</code> in your web page, the Struts framework
generates HTML that styles
the appearance and controls the layout of the select control. The style and
layout is determined by which Struts theme
-is set for the tag. Struts comes with three built-in themes: <code
class="language-plaintext highlighter-rouge">simple</code>, <code
class="language-plaintext highlighter-rouge">xhtml</code>, and <code
class="language-plaintext highlighter-rouge">css_xhtml</code>. If you don’t
specify
+is set for the tag. Struts comes with four built-in themes: <code
class="language-plaintext highlighter-rouge">simple</code>, <code
class="language-plaintext highlighter-rouge">xhtml</code>, <code
class="language-plaintext highlighter-rouge">css_xhtml</code>, and <code
class="language-plaintext highlighter-rouge">html5</code>. If you don’t specify
a theme, then Struts will use the <code class="language-plaintext
highlighter-rouge">xhtml</code> theme by default.</p>
<p>The <a href="http://struts.apache.org/mail">Struts user mailing list</a> is
an excellent place to get help. If you are having
@@ -206,10 +206,10 @@ select tag the default <code class="language-plaintext
highlighter-rouge">xhtml<
<h2 id="specifying-the-theme-struts-should-use">Specifying The Theme Struts
Should Use</h2>
<p>The Struts tags have a theme attribute you can use to specify which Struts
theme should be used when creating the HTML
-for that tag. The values for the theme attribute are <code
class="language-plaintext highlighter-rouge">simple</code>, <code
class="language-plaintext highlighter-rouge">xhtml</code>, <code
class="language-plaintext highlighter-rouge">css_xhtml</code>, and <code
class="language-plaintext highlighter-rouge">ajax</code>. To learn more about
these themes
-visit <a href="../tag-developers/themes-and-templates">Themes and Templates
Documentation</a>. This tutorial will review
-the <code class="language-plaintext highlighter-rouge">xhtml</code>, <code
class="language-plaintext highlighter-rouge">css_xhtml</code>, and the <code
class="language-plaintext highlighter-rouge">simple</code> themes. The <code
class="language-plaintext highlighter-rouge">ajax</code> theme is a special
theme used for ajax operations
-(see <a href="../tag-developers/ajax-theme">Ajax Theme in the
documentation</a>).</p>
+for that tag. The values for the theme attribute are <code
class="language-plaintext highlighter-rouge">simple</code>, <code
class="language-plaintext highlighter-rouge">xhtml</code>, <code
class="language-plaintext highlighter-rouge">css_xhtml</code>, <code
class="language-plaintext highlighter-rouge">html5</code>, and <code
class="language-plaintext highlighter-rouge">ajax</code>. To learn more
+about these themes visit <a
href="../tag-developers/themes-and-templates">Themes and Templates
Documentation</a>. This tutorial will review the <code
class="language-plaintext highlighter-rouge">xhtml</code>, <code
class="language-plaintext highlighter-rouge">css_xhtml</code>,
+and the <code class="language-plaintext highlighter-rouge">simple</code>
themes. The <code class="language-plaintext highlighter-rouge">html5</code>
theme extends the simple theme with modern HTML5 output (see <a
href="../tag-developers/html5-theme">HTML5 Theme in the documentation</a>.
+The <code class="language-plaintext highlighter-rouge">ajax</code> theme is a
special theme used for ajax operations (see <a
href="../tag-developers/ajax-theme">Ajax Theme in the documentation</a>).</p>
<p>You can specify the theme on a per Struts tag basis or you can use one of
the following methods to specify what theme
Struts should use:</p>
diff --git a/content/tag-developers/themes-and-templates.html
b/content/tag-developers/html5-theme.html
similarity index 55%
copy from content/tag-developers/themes-and-templates.html
copy to content/tag-developers/html5-theme.html
index 4b7432209..929c5e519 100644
--- a/content/tag-developers/themes-and-templates.html
+++ b/content/tag-developers/html5-theme.html
@@ -7,7 +7,7 @@
<meta http-equiv="Content-Language" content="en"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <title>Themes and Templates</title>
+ <title>Tag Developers Guide</title>
<link href="/css/source-sans-pro.css" rel="stylesheet" type="text/css">
<link href="/css/font-awesome.css" rel="stylesheet">
@@ -147,82 +147,142 @@
<article class="container">
<section class="col-md-12">
- <a class="edit-on-gh"
href="https://github.com/apache/struts-site/edit/main/source/tag-developers/themes-and-templates.md"
title="Edit this page on GitHub">Edit on GitHub</a>
+ <a class="edit-on-gh"
href="https://github.com/apache/struts-site/edit/main/source/tag-developers/html5-theme.md"
title="Edit this page on GitHub">Edit on GitHub</a>
- <a href="index" title="back to Tag Developers Guide"><< back to Tag
Developers Guide</a>
+ <a href="themes-and-templates" title="back to Themes and Templates"><<
back to Themes and Templates</a>
- <h1 id="themes-and-templates">Themes and Templates</h1>
-
-<p>The notions of “themes” and “templates” are at the core of the HTML <a
href="struts-tags">Struts Tags</a> provided by the framework.</p>
-
-<h2 id="definitions">Definitions</h2>
-
-<table>
- <tbody>
- <tr>
- <td>tag</td>
- <td>A small piece of code executed from within <a href="jsp">JSP</a>, <a
href="freemarker">FreeMarker</a>, or <a href="velocity">Velocity</a>.</td>
- </tr>
- <tr>
- <td>template</td>
- <td>A bit of code, usually written in <a
href="freemarker">FreeMarker</a>, that can be rendered by certain tags (HTML
tags)</td>
- </tr>
- <tr>
- <td>theme</td>
- <td>A collection of <em>templates</em> packaged together to provide
common functionality</td>
- </tr>
- </tbody>
-</table>
-
-<blockquote>
- <p>See <a href="struts-tags">Struts Tags</a> for more about the HTML and
other tags provided by the framework.</p>
-</blockquote>
-
-<h2 id="template-basics">Template Basics</h2>
-
-<table>
- <tbody>
- <tr>
- <td><a href="template-loading">Template Loading</a></td>
- <td>How templates are loaded</td>
- </tr>
- <tr>
- <td><a href="selecting-template-directory">Selecting Template
Directory</a></td>
- <td>How the template directories are loaded</td>
- </tr>
- <tr>
- <td><a href="selecting-themes">Selecting Themes</a></td>
- <td>How you can pick a theme when writing your results</td>
- </tr>
- <tr>
- <td><a href="extending-themes">Extending Themes</a></td>
- <td>How to create your own themes based on existing themes</td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="more-about-themes">More About Themes</h2>
-
-<table>
- <tbody>
- <tr>
- <td><a href="simple-theme">simple theme</a></td>
- <td>A minimal theme with no “bells and whistles”</td>
- </tr>
- <tr>
- <td><a href="xhtml-theme">xhtml theme</a></td>
- <td>The default theme that uses common HTML practices</td>
- </tr>
- <tr>
- <td><a href="css-xhtml-theme">css_xhtml theme</a></td>
- <td>The <a href="xhtml-theme">xhtml theme</a> re-implemented using
strictly CSS for layout</td>
- </tr>
- <tr>
- <td><a href="ajax-theme">ajax theme</a></td>
- <td>A theme based on the <a href="xhtml-theme">xhtml theme</a> that
provides advanced AJAX features</td>
- </tr>
- </tbody>
-</table>
+ <h1 class="no_toc" id="html5-theme">html5 theme</h1>
+
+<ul id="markdown-toc">
+ <li><a href="#features" id="markdown-toc-features">Features</a></li>
+ <li><a href="#theme-configuration"
id="markdown-toc-theme-configuration">Theme Configuration</a></li>
+ <li><a href="#using-the-html5-theme"
id="markdown-toc-using-the-html5-theme">Using the HTML5 Theme</a></li>
+ <li><a href="#available-templates"
id="markdown-toc-available-templates">Available Templates</a></li>
+ <li><a href="#text-field-template-example"
id="markdown-toc-text-field-template-example">Text Field Template
Example</a></li>
+ <li><a href="#since" id="markdown-toc-since">Since</a></li>
+</ul>
+
+<p>The <em>html5 theme</em> extends the <a href="simple-theme">simple
theme</a> and provides modern HTML5 output.</p>
+
+<h2 id="features">Features</h2>
+
+<ul>
+ <li>Extends the <a href="simple-theme">simple theme</a> via <code
class="language-plaintext highlighter-rouge">theme.properties</code></li>
+ <li>Clean, modern HTML5 markup output</li>
+ <li><a href="../core-developers/validation">Validation</a> and error
reporting</li>
+</ul>
+
+<h2 id="theme-configuration">Theme Configuration</h2>
+
+<p>The HTML5 theme extends the simple theme via <code
class="language-plaintext highlighter-rouge">theme.properties</code>:</p>
+
+<figure class="highlight"><pre><code class="language-properties"
data-lang="properties"><span class="c">#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+</span><span class="py">parent</span> <span class="p">=</span> <span
class="s">simple</span></code></pre></figure>
+
+<h2 id="using-the-html5-theme">Using the HTML5 Theme</h2>
+
+<p>Set the theme on individual tags:</p>
+
+<div class="language-jsp highlighter-rouge"><div class="highlight"><pre
class="highlight"><code><span class="nt"><s:textfield </span><span
class="na">name=</span><span class="s">"username"</span><span class="na">
theme=</span><span class="s">"html5"</span> <span class="nt">/></span>
+</code></pre></div></div>
+
+<p>Or set it for an entire form:</p>
+
+<div class="language-jsp highlighter-rouge"><div class="highlight"><pre
class="highlight"><code><span class="nt"><s:form </span><span
class="na">action=</span><span class="s">"login"</span><span class="na">
theme=</span><span class="s">"html5"</span><span class="nt">></span>
+ <span class="nt"><s:textfield </span><span class="na">name=</span><span
class="s">"username"</span> <span class="nt">/></span>
+ <span class="nt"><s:password </span><span class="na">name=</span><span
class="s">"password"</span> <span class="nt">/></span>
+ <span class="nt"><s:submit </span><span class="na">value=</span><span
class="s">"Login"</span> <span class="nt">/></span>
+<span class="nt"></s:form></span>
+</code></pre></div></div>
+
+<p>Or globally in <code class="language-plaintext
highlighter-rouge">struts.xml</code>:</p>
+
+<div class="language-xml highlighter-rouge"><div class="highlight"><pre
class="highlight"><code><span class="nt"><constant</span> <span
class="na">name=</span><span class="s">"struts.ui.theme"</span> <span
class="na">value=</span><span class="s">"html5"</span> <span
class="nt">/></span>
+</code></pre></div></div>
+
+<h2 id="available-templates">Available Templates</h2>
+
+<p>The HTML5 theme includes templates for all standard Struts UI tags
including:
+textfield, textarea, password, checkbox, checkboxlist, radio, select, file,
+hidden, label, combobox, reset, submit, form, and more.</p>
+
+<h2 id="text-field-template-example">Text Field Template Example</h2>
+
+<figure class="highlight"><pre><code class="language-freemarker"
data-lang="freemarker"><#--
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+-->
+<#include
"/${attributes.templateDir}/${attributes.expandTheme}/controlheader.ftl"
/><#rt/>
+<input<#rt/>
+ type="${(attributes.type!"text")}"<#rt/>
+ name="${(attributes.name!"")}"<#rt/>
+<#if attributes.get("size")?has_content>
+ size="${attributes.get("size")}"<#rt/>
+</#if>
+<#if attributes.maxlength?has_content>
+ maxlength="${attributes.maxlength}"<#rt/>
+</#if>
+<#if attributes.nameValue??>
+ value="${attributes.nameValue}"<#rt/>
+</#if>
+<#if attributes.disabled!false>
+ disabled="disabled"<#rt/>
+</#if>
+<#if attributes.readonly!false>
+ readonly="readonly"<#rt/>
+</#if>
+<#if attributes.tabindex?has_content>
+ tabindex="${attributes.tabindex}"<#rt/>
+</#if>
+<#if attributes.id?has_content>
+ id="${attributes.id}"<#rt/>
+</#if>
+<#include "/${attributes.templateDir}/${attributes.expandTheme}/css.ftl"
/>
+<#if attributes.title?has_content>
+ title="${attributes.title}"<#rt/>
+</#if>
+<#include
"/${attributes.templateDir}/${attributes.expandTheme}/scripting-events.ftl"
/><#rt/>
+<#include
"/${attributes.templateDir}/${attributes.expandTheme}/common-attributes.ftl"
/><#rt/>
+<#include
"/${attributes.templateDir}/${attributes.expandTheme}/dynamic-attributes.ftl"
/><#rt/>
+/><#rt/>
+<#include
"/${attributes.templateDir}/${attributes.expandTheme}/controlfooter.ftl"
/><#rt/></code></pre></figure>
+
+<h2 id="since">Since</h2>
+
+<p>Available since Struts 7.2.0</p>
</section>
</article>
diff --git a/content/tag-developers/themes-and-templates.html
b/content/tag-developers/themes-and-templates.html
index 4b7432209..cab09461b 100644
--- a/content/tag-developers/themes-and-templates.html
+++ b/content/tag-developers/themes-and-templates.html
@@ -217,6 +217,10 @@
<td><a href="css-xhtml-theme">css_xhtml theme</a></td>
<td>The <a href="xhtml-theme">xhtml theme</a> re-implemented using
strictly CSS for layout</td>
</tr>
+ <tr>
+ <td><a href="html5-theme">html5 theme</a></td>
+ <td>A modern HTML5 theme extending simple theme with clean HTML5
output</td>
+ </tr>
<tr>
<td><a href="ajax-theme">ajax theme</a></td>
<td>A theme based on the <a href="xhtml-theme">xhtml theme</a> that
provides advanced AJAX features</td>