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 207b2cc0d Updates stage by Jenkins
207b2cc0d is described below
commit 207b2cc0d3c5d797b2a5b69a1ecf4c49400f96bc
Author: jenkins <[email protected]>
AuthorDate: Fri Oct 17 10:05:21 2025 +0000
Updates stage by Jenkins
---
content/core-developers/action-configuration.html | 4 +++
content/core-developers/validation.html | 33 +++++++++++++++++++++-
.../getting-started/form-validation-using-xml.html | 4 +++
3 files changed, 40 insertions(+), 1 deletion(-)
diff --git a/content/core-developers/action-configuration.html
b/content/core-developers/action-configuration.html
index 83d4d30bd..615b9d7da 100644
--- a/content/core-developers/action-configuration.html
+++ b/content/core-developers/action-configuration.html
@@ -229,6 +229,10 @@ to specifically allow slashes in your action names via a
constant in the <code c
<p>See <a href="https://issues.apache.org/jira/browse/WW-1383">JIRA Issue
WW-1383</a> for discussion as there are side effects
to setting this property to <code class="language-plaintext
highlighter-rouge">true</code>.</p>
+<blockquote>
+ <p><strong>Note:</strong> When using slashes in action names, validation
file naming requires special attention. Slashes in action aliases are replaced
with hyphens in validation file names. See <a
href="validation#validation-files-for-actions-with-slashes">Validation Files
for Actions with Slashes</a> for detailed information.</p>
+</blockquote>
+
<p><strong>Action Names with Dots and Dashes</strong></p>
<p>Although action naming is pretty flexible, one should pay attention when
using dots (eg. create.user) and/or dashes
diff --git a/content/core-developers/validation.html
b/content/core-developers/validation.html
index 82d6a248e..b54f57ce9 100644
--- a/content/core-developers/validation.html
+++ b/content/core-developers/validation.html
@@ -162,7 +162,10 @@
<li><a href="#turning-on-validation"
id="markdown-toc-turning-on-validation">Turning on Validation</a></li>
<li><a href="#validator-scopes" id="markdown-toc-validator-scopes">Validator
Scopes</a></li>
<li><a href="#notes" id="markdown-toc-notes">Notes</a></li>
- <li><a href="#defining-validation-rules"
id="markdown-toc-defining-validation-rules">Defining Validation Rules</a></li>
+ <li><a href="#defining-validation-rules"
id="markdown-toc-defining-validation-rules">Defining Validation Rules</a>
<ul>
+ <li><a href="#validation-files-for-actions-with-slashes"
id="markdown-toc-validation-files-for-actions-with-slashes">Validation Files
for Actions with Slashes</a></li>
+ </ul>
+ </li>
<li><a href="#localizing-and-parameterizing-messages"
id="markdown-toc-localizing-and-parameterizing-messages">Localizing and
Parameterizing Messages</a> <ul>
<li><a href="#customizing-validation-messages"
id="markdown-toc-customizing-validation-messages">Customizing validation
messages</a></li>
</ul>
@@ -313,6 +316,34 @@ XWork searches up the inheritance tree of the action to
find default
validations for parent classes of the Action and interfaces implemented</li>
</ol>
+<h3 id="validation-files-for-actions-with-slashes">Validation Files for
Actions with Slashes</h3>
+
+<p>When using action names with slashes (enabled via <code
class="language-plaintext
highlighter-rouge">struts.enable.SlashesInActionNames</code>), the validation
file naming follows a special rule: <strong>slashes in the action alias are
replaced with hyphens</strong>.</p>
+
+<p><strong>Pattern:</strong> <code class="language-plaintext
highlighter-rouge">ClassName-{action-alias-with-slashes-replaced-by-hyphens}-validation.xml</code></p>
+
+<p><strong>Example:</strong></p>
+
+<p>For this action configuration:</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.enable.SlashesInActionNames"</span> <span
class="na">value=</span><span class="s">"true"</span><span
class="nt">/></span>
+
+<span class="nt"><action</span> <span class="na">name=</span><span
class="s">"a/b/myaction.validate"</span>
+ <span class="na">class=</span><span class="s">"myPath.MyAction"</span>
+ <span class="na">method=</span><span class="s">"create"</span><span
class="nt">></span>
+ <span class="nt"><result</span> <span class="na">name=</span><span
class="s">"input"</span> <span class="na">type=</span><span
class="s">"tiles"</span><span class="nt">></span>mytiles<span
class="nt"></result></span>
+<span class="nt"></action></span>
+</code></pre></div></div>
+
+<p>The validation file should be named:</p>
+<ul>
+ <li><strong>Action-specific alias validation:</strong> <code
class="language-plaintext
highlighter-rouge">MyAction-a-b-myaction.validate-validation.xml</code></li>
+ <li><strong>General action validation:</strong> <code
class="language-plaintext highlighter-rouge">MyAction-validation.xml</code>
(applies to all aliases)</li>
+</ul>
+
+<p><strong>Location:</strong> Place validation files in <code
class="language-plaintext highlighter-rouge">src/main/resources/myPath/</code>
(following your package structure)</p>
+
+<p>This behavior is implemented in <code class="language-plaintext
highlighter-rouge">AnnotationActionValidatorManager</code> where <code
class="language-plaintext highlighter-rouge">context.replace('/', '-')</code>
converts the action alias for file resolution.</p>
+
<p>Here is an example for SimpleAction-validation.xml:</p>
<div class="language-xml highlighter-rouge"><div class="highlight"><pre
class="highlight"><code><span class="cp"><!DOCTYPE validators PUBLIC
"-//Apache Struts//XWork Validator 1.0.3//EN"
diff --git a/content/getting-started/form-validation-using-xml.html
b/content/getting-started/form-validation-using-xml.html
index 06221a0c9..272318880 100644
--- a/content/getting-started/form-validation-using-xml.html
+++ b/content/getting-started/form-validation-using-xml.html
@@ -194,6 +194,10 @@ The information that can be edited is encapsulated in an
object of class Person.
The XML file that contains the validation rules must be named as
ActionClassName-validation.xml. In the example
application, the XML validation file is named EditAction-validation.xml (see
src/main/resources/org/apache/struts/edit/action).</p>
+<blockquote>
+ <p><strong>Note:</strong> When using action names with slashes (enabled via
<code class="language-plaintext
highlighter-rouge">struts.enable.SlashesInActionNames</code>), validation file
naming follows a special rule where slashes are replaced with hyphens. See <a
href="../core-developers/validation#validation-files-for-actions-with-slashes">Validation
Files for Actions with Slashes</a> for detailed information.</p>
+</blockquote>
+
<p>Struts provides several different validators that you can use in the XML
validation file. See <a href="../core-developers/validation">Validation</a>
for a list of validators you can employ.</p>