This is an automated email from the ASF dual-hosted git repository. lukaszlenart pushed a commit to branch docs/WW-5444-html5-theme-documentation in repository https://gitbox.apache.org/repos/asf/struts-site.git
commit 5c526b8f63754b4189e331bd59441d181da6bc1f Author: Lukasz Lenart <[email protected]> AuthorDate: Sun Dec 14 19:40:47 2025 +0100 WW-5444 Add documentation for HTML5 theme - Create new html5-theme.md documentation page - Add HTML5 theme to themes-and-templates.md list - Update getting-started/themes.md to include HTML5 theme 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> --- source/getting-started/themes.md | 10 ++-- source/tag-developers/html5-theme.md | 69 +++++++++++++++++++++++++++ source/tag-developers/themes-and-templates.md | 1 + 3 files changed, 75 insertions(+), 5 deletions(-) diff --git a/source/getting-started/themes.md b/source/getting-started/themes.md index a22df7276..6304309ec 100644 --- a/source/getting-started/themes.md +++ b/source/getting-started/themes.md @@ -18,7 +18,7 @@ The example code for this tutorial, **themes**, is available for checkout at [st When you use a Struts tag such as `s:select` 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: `simple`, `xhtml`, and `css_xhtml`. If you don’t specify +is set for the tag. Struts comes with four built-in themes: `simple`, `xhtml`, `css_xhtml`, and `html5`. If you don't specify a theme, then Struts will use the `xhtml` theme by default. The [Struts user mailing list](http://struts.apache.org/mail) is an excellent place to get help. If you are having @@ -59,10 +59,10 @@ select tag the default `xhtml` theme was used. ## Specifying The Theme Struts Should Use 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 `simple`, `xhtml`, `css_xhtml`, and `ajax`. To learn more about these themes -visit [Themes and Templates Documentation](../tag-developers/themes-and-templates). This tutorial will review -the `xhtml`, `css_xhtml`, and the `simple` themes. The `ajax` theme is a special theme used for ajax operations -(see [Ajax Theme in the documentation](../tag-developers/ajax-theme)). +for that tag. The values for the theme attribute are `simple`, `xhtml`, `css_xhtml`, `html5`, and `ajax`. To learn more +about these themes visit [Themes and Templates Documentation](../tag-developers/themes-and-templates). This tutorial will review the `xhtml`, `css_xhtml`, +and the `simple` themes. The `html5` theme extends the simple theme with modern HTML5 output (see [HTML5 Theme in the documentation](../tag-developers/html5-theme). +The `ajax` theme is a special theme used for ajax operations (see [Ajax Theme in the documentation](../tag-developers/ajax-theme)). 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: diff --git a/source/tag-developers/html5-theme.md b/source/tag-developers/html5-theme.md new file mode 100644 index 000000000..896d616f1 --- /dev/null +++ b/source/tag-developers/html5-theme.md @@ -0,0 +1,69 @@ +--- +layout: default +title: Tag Developers Guide +parent: + url: themes-and-templates + title: Themes and Templates +--- + +# html5 theme +{:.no_toc} + +* Will be replaced with the ToC, excluding a header +{:toc} + +The _html5 theme_ extends the [simple theme](simple-theme) and provides modern HTML5 output. + +## Features + +- Extends the [simple theme](simple-theme) via `theme.properties` +- Clean, modern HTML5 markup output +- [Validation](../core-developers/validation) and error reporting + +## Theme Configuration + +The HTML5 theme extends the simple theme via `theme.properties`: + +{% highlight properties %} +{% remote_file_content https://raw.githubusercontent.com/apache/struts/main/core/src/main/resources/template/html5/theme.properties %} +{% endhighlight %} + +## Using the HTML5 Theme + +Set the theme on individual tags: + +```jsp +<s:textfield name="username" theme="html5" /> +``` + +Or set it for an entire form: + +```jsp +<s:form action="login" theme="html5"> + <s:textfield name="username" /> + <s:password name="password" /> + <s:submit value="Login" /> +</s:form> +``` + +Or globally in `struts.xml`: + +```xml +<constant name="struts.ui.theme" value="html5" /> +``` + +## Available Templates + +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. + +## Text Field Template Example + +{% highlight freemarker %} +{% remote_file_content https://raw.githubusercontent.com/apache/struts/main/core/src/main/resources/template/html5/text.ftl %} +{% endhighlight %} + +## Since + +Available since Struts 7.2.0 diff --git a/source/tag-developers/themes-and-templates.md b/source/tag-developers/themes-and-templates.md index c248a2b44..c58830387 100644 --- a/source/tag-developers/themes-and-templates.md +++ b/source/tag-developers/themes-and-templates.md @@ -30,4 +30,5 @@ The notions of "themes" and "templates" are at the core of the HTML [Struts Tags |[simple theme](simple-theme)| A minimal theme with no "bells and whistles" | |[xhtml theme](xhtml-theme)| The default theme that uses common HTML practices | |[css_xhtml theme](css-xhtml-theme)| The [xhtml theme](xhtml-theme) re-implemented using strictly CSS for layout | +|[html5 theme](html5-theme)| A modern HTML5 theme extending simple theme with clean HTML5 output | |[ajax theme](ajax-theme)| A theme based on the [xhtml theme](xhtml-theme) that provides advanced AJAX features |
