Repository: struts-site
Updated Branches:
  refs/heads/asf-site 5474d2180 -> 740bd3f6d


Updates production by Jenkins


Project: http://git-wip-us.apache.org/repos/asf/struts-site/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts-site/commit/740bd3f6
Tree: http://git-wip-us.apache.org/repos/asf/struts-site/tree/740bd3f6
Diff: http://git-wip-us.apache.org/repos/asf/struts-site/diff/740bd3f6

Branch: refs/heads/asf-site
Commit: 740bd3f6de3297b9b815466a4a00e2b386ce5f09
Parents: 5474d21
Author: jenkins <bui...@apache.org>
Authored: Mon Sep 11 19:58:52 2017 +0000
Committer: jenkins <bui...@apache.org>
Committed: Mon Sep 11 19:58:52 2017 +0000

----------------------------------------------------------------------
 .../conditionalvisitor-validator.html           | 25 ++++---
 content/core-developers/email-validator.html    | 66 ++++++++++++------
 .../fieldexpression-validator.html              | 47 ++++++++-----
 content/core-developers/regex-validator.html    | 63 ++++++++++++------
 content/core-developers/short-validator.html    | 66 ++++++++++++------
 .../core-developers/stringlength-validator.html | 70 +++++++++++++-------
 content/core-developers/visitor-validator.html  | 51 ++++++++------
 7 files changed, 253 insertions(+), 135 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts-site/blob/740bd3f6/content/core-developers/conditionalvisitor-validator.html
----------------------------------------------------------------------
diff --git a/content/core-developers/conditionalvisitor-validator.html 
b/content/core-developers/conditionalvisitor-validator.html
index 940fa38..1e5b76d 100644
--- a/content/core-developers/conditionalvisitor-validator.html
+++ b/content/core-developers/conditionalvisitor-validator.html
@@ -127,22 +127,25 @@
     <a class="edit-on-gh" 
href="https://github.com/apache/struts-site/edit/master/source/core-developers/conditionalvisitor-validator.md";
 title="Edit this page on GitHub">Edit on GitHub</a>
     <h1 id="conditionalvisitor-validator">conditionalvisitor validator</h1>
 
-<p>####Description####</p>
+<h3 id="description">Description</h3>
 
-<div class="highlighter-rouge"><pre class="highlight"><code><span 
class="p">{</span><span 
class="err">snippet:id=javadoc|javadoc=true|url=com.opensymphony.xwork2.validator.validators.ConditionalVisitorFieldValidator</span><span
 class="p">}</span><span class="w">
-</span></code></pre>
-</div>
+<p>The ConditionalVisitorFieldValidator will forward validation to the 
VisitorFieldValidator only if the expression will evaluate to true.</p>
 
-<p>####Parameters####</p>
+<h3 id="parameters">Parameters</h3>
 
-<div class="highlighter-rouge"><pre class="highlight"><code><span 
class="p">{</span><span 
class="err">snippet:id=parameters|javadoc=true|url=com.opensymphony.xwork2.validator.validators.ConditionalVisitorFieldValidator</span><span
 class="p">}</span><span class="w">
-</span></code></pre>
-</div>
+<ul>
+  <li><code class="highlighter-rouge">expression</code> - an OGNL expression 
which should evaluate to true to pass validation to the 
VisitorFieldValidator.</li>
+</ul>
 
-<p>####Examples####</p>
+<h3 id="examples">Examples</h3>
 
-<div class="highlighter-rouge"><pre class="highlight"><code><span 
class="p">{</span><span 
class="err">snippet:id=example|lang=xml|javadoc=true|url=com.opensymphony.xwork2.validator.validators.ConditionalVisitorFieldValidator</span><span
 class="p">}</span><span class="w">
-</span></code></pre>
+<div class="highlighter-rouge"><pre class="highlight"><code>&lt;field 
name="colleaguePosition"&gt;
+    &lt;field-validator type="conditionalvisitor"&gt;
+        &lt;param name="expression"&gt;reason == 'colleague' and 
colleaguePositionID == 'OTHER'&lt;/param&gt;
+        &lt;message&gt;You must select reason Colleague and position 
Other&lt;/message&gt;
+    &lt;/field-validator&gt;
+&lt;/field&gt;
+</code></pre>
 </div>
 
   </section>

http://git-wip-us.apache.org/repos/asf/struts-site/blob/740bd3f6/content/core-developers/email-validator.html
----------------------------------------------------------------------
diff --git a/content/core-developers/email-validator.html 
b/content/core-developers/email-validator.html
index 4fc50d8..a5969a5 100644
--- a/content/core-developers/email-validator.html
+++ b/content/core-developers/email-validator.html
@@ -127,36 +127,60 @@
     <a class="edit-on-gh" 
href="https://github.com/apache/struts-site/edit/master/source/core-developers/email-validator.md";
 title="Edit this page on GitHub">Edit on GitHub</a>
     <h1 id="email-validator">email validator</h1>
 
-<p>####Description####</p>
+<h3 id="description">Description</h3>
 
-<div class="highlighter-rouge"><pre class="highlight"><code><span 
class="p">{</span><span 
class="err">snippet:id=javadoc|javadoc=true|url=com.opensymphony.xwork2.validator.validators.EmailValidator</span><span
 class="p">}</span><span class="w">
-</span></code></pre>
-</div>
+<p>EmailValidator checks that a given String field, if not empty, is a valid 
email address.</p>
 
-<p>####Parameters####</p>
+<p>The regular expression used to validate that the string is an email address 
is:</p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code><span 
class="p">{</span><span 
class="err">snippet:id=parameters|javadoc=true|url=com.opensymphony.xwork2.validator.validators.EmailValidator</span><span
 class="p">}</span><span class="w">
-</span></code></pre>
+<div class="highlighter-rouge"><pre 
class="highlight"><code>\\b^['_a-z0-9-\\+](\\.['_a-z0-9-\\+])@[a-z0-9-](\\.[a-z0-9-])\\.([a-z]{2,6})$\\b
+</code></pre>
 </div>
 
-<p><strong>(!) Warning</strong></p>
+<p>You can also specify <code class="highlighter-rouge">expression</code>, 
<code class="highlighter-rouge">caseSensitive</code> and <code 
class="highlighter-rouge">trim</code> params as a OGNL expression, see the 
example below.</p>
+
+<h3 id="parameters">Parameters</h3>
+
+<ul>
+  <li><code class="highlighter-rouge">fieldName</code> - The field name this 
validator is validating. Required if using Plain-Validator Syntax otherwise not 
required.</li>
+</ul>
+
+<p>Check also documentation of the <code 
class="highlighter-rouge">RegexpValidator</code> for more details - the 
EmailValidator is based on it.</p>
 
 <blockquote>
-  <table>
-    <tbody>
-      <tr>
-        <td>{snippet:id=parameters-warning</td>
-        <td>javadoc=true</td>
-        
<td>url=com.opensymphony.xwork2.validator.validators.EmailValidator}</td>
-      </tr>
-    </tbody>
-  </table>
+  <p>Warning
+Do not use <code class="highlighter-rouge">${regexExpression}</code>, <code 
class="highlighter-rouge">${caseSensitiveExpression}</code> and <code 
class="highlighter-rouge">${trimExpression}</code> as an expression as this 
will turn into infinitive loop!</p>
 </blockquote>
 
-<p>####Examples####</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code><span 
class="p">{</span><span 
class="err">snippet:id=example|lang=xml|javadoc=true|url=com.opensymphony.xwork2.validator.validators.EmailValidator</span><span
 class="p">}</span><span class="w">
-</span></code></pre>
+<h3 id="examples">Examples</h3>
+
+<div class="highlighter-rouge"><pre class="highlight"><code>&lt;!-- Plain 
Validator Syntax --&gt;
+&lt;validators&gt;
+    &lt;validator type="email"&gt;
+        &lt;param name="fieldName"&gt;myEmail&lt;/param&gt;
+        &lt;message&gt;Must provide a valid email&lt;/message&gt;
+    &lt;/validator&gt;
+&lt;/validators&gt;
+ 
+&lt;!-- Field Validator Syntax --&gt;
+&lt;field name="myEmail"&gt;
+   &lt;field-validator type="email"&gt;
+      &lt;message&gt;Must provide a valid email&lt;/message&gt;
+   &lt;/field-validator&gt;
+&lt;/field&gt;
+ 
+&lt;!-- Field Validator Syntax with expressions --&gt;
+&lt;!-- Only available when used with xml based configuration, if you want to 
have the same
+        flexibility with annotations use @RegexFieldValidator instead --&gt;
+&lt;field name="myEmail"&gt;
+   &lt;field-validator type="email"&gt;
+      &lt;param name="regexExpression"&gt;${emailPattern}&lt;/param&gt; 
&lt;!-- will be evaluated as: String getEmailPattern() --&gt;
+      &lt;param 
name="caseSensitiveExpression"&gt;${emailCaseSensitive}&lt;/param&gt; &lt;!-- 
will be evaluated as: boolean getEmailCaseSensitive() --&gt;
+      &lt;param name="trimExpression"&gt;${trimEmail}&lt;/param&gt; &lt;!-- 
will be evaluated as: boolean getTrimEmail() --&gt;
+      &lt;message&gt;Must provide a valid email&lt;/message&gt;
+   &lt;/field-validator&gt;
+&lt;/field&gt;
+</code></pre>
 </div>
 
   </section>

http://git-wip-us.apache.org/repos/asf/struts-site/blob/740bd3f6/content/core-developers/fieldexpression-validator.html
----------------------------------------------------------------------
diff --git a/content/core-developers/fieldexpression-validator.html 
b/content/core-developers/fieldexpression-validator.html
index ddc1c9f..76ea4fa 100644
--- a/content/core-developers/fieldexpression-validator.html
+++ b/content/core-developers/fieldexpression-validator.html
@@ -127,22 +127,37 @@
     <a class="edit-on-gh" 
href="https://github.com/apache/struts-site/edit/master/source/core-developers/fieldexpression-validator.md";
 title="Edit this page on GitHub">Edit on GitHub</a>
     <h1 id="fieldexpression-validator">fieldexpression validator</h1>
 
-<p>####Description####</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code><span 
class="p">{</span><span 
class="err">snippet:id=javadoc|javadoc=true|url=com.opensymphony.xwork2.validator.validators.FieldExpressionValidator</span><span
 class="p">}</span><span class="w">
-</span></code></pre>
-</div>
-
-<p>####Parameters####</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code><span 
class="p">{</span><span 
class="err">snippet:id=parameters|javadoc=true|url=com.opensymphony.xwork2.validator.validators.FieldExpressionValidator</span><span
 class="p">}</span><span class="w">
-</span></code></pre>
-</div>
-
-<p>####Examples####</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code><span 
class="p">{</span><span 
class="err">snippet:id=example|javadoc=true|lang=xml|url=com.opensymphony.xwork2.validator.validators.FieldExpressionValidator</span><span
 class="p">}</span><span class="w">
-</span></code></pre>
+<h3 id="description">Description</h3>
+
+<p>Validates a field using an OGNL expression.</p>
+
+<h3 id="parameters">Parameters</h3>
+
+<ul>
+  <li><code class="highlighter-rouge">fieldName</code> - The field name this 
validator is validating. Required if using Plain-Validator Syntax otherwise not 
required.</li>
+  <li><code class="highlighter-rouge">expression</code> - The Ognl expression 
(must evaluate to a boolean) which is to be validated the stack.</li>
+</ul>
+
+<h3 id="examples">Examples</h3>
+
+<div class="highlighter-rouge"><pre class="highlight"><code>&lt;!-- Plain 
Validator Syntax --&gt;
+&lt;validators&gt;
+    &lt;!-- Plain Validator Syntax --&gt;
+    &lt;validator type="fieldexpression"&gt;
+       &lt;param name="fieldName"&gt;myField&lt;/param&gt;
+       &lt;param name="expression"&gt;&lt;![CDATA[#myCreditLimit &gt; 
#myGirfriendCreditLimit]]&gt;&lt;/param&gt;
+       &lt;message&gt;My credit limit should be MORE than my 
girlfriend&lt;/message&gt;
+    &lt;validator&gt;
+     
+    &lt;!-- Field Validator Syntax --&gt;
+    &lt;field name="myField"&gt;
+        &lt;field-validator type="fieldexpression"&gt;
+            &lt;param name="expression"&gt;&lt;![CDATA[#myCreditLimit &gt; 
#myGirfriendCreditLimit]]&gt;&lt;/param&gt;
+            &lt;message&gt;My credit limit should be MORE than my 
girlfriend&lt;/message&gt;
+        &lt;/field-validator&gt;
+    &lt;/field&gt;
+&lt;/vaidators&gt;
+</code></pre>
 </div>
 
   </section>

http://git-wip-us.apache.org/repos/asf/struts-site/blob/740bd3f6/content/core-developers/regex-validator.html
----------------------------------------------------------------------
diff --git a/content/core-developers/regex-validator.html 
b/content/core-developers/regex-validator.html
index c970729..ad86a0e 100644
--- a/content/core-developers/regex-validator.html
+++ b/content/core-developers/regex-validator.html
@@ -127,36 +127,55 @@
     <a class="edit-on-gh" 
href="https://github.com/apache/struts-site/edit/master/source/core-developers/regex-validator.md";
 title="Edit this page on GitHub">Edit on GitHub</a>
     <h1 id="regex-validator">regex validator</h1>
 
-<p>####Description####</p>
+<h3 id="description">Description</h3>
 
-<div class="highlighter-rouge"><pre class="highlight"><code><span 
class="p">{</span><span 
class="err">snippet:id=javadoc|javadoc=true|url=com.opensymphony.xwork2.validator.validators.RegexFieldValidator</span><span
 class="p">}</span><span class="w">
-</span></code></pre>
-</div>
+<p>Validates a string field using a regular expression.</p>
 
-<p>####Parameters####</p>
+<h3 id="parameters">Parameters</h3>
 
-<div class="highlighter-rouge"><pre class="highlight"><code><span 
class="p">{</span><span 
class="err">snippet:id=parameters|javadoc=true|url=com.opensymphony.xwork2.validator.validators.RegexFieldValidator</span><span
 class="p">}</span><span class="w">
-</span></code></pre>
-</div>
+<ul>
+  <li><code class="highlighter-rouge">fieldName</code> - The field name this 
validator is validating. Required if using Plain-Validator Syntax otherwise not 
required.</li>
+  <li><code class="highlighter-rouge">regexp</code> - The RegExp 
expression</li>
+  <li><code class="highlighter-rouge">caseSensitive</code> - Boolean 
(Optional). Sets whether the expression should be matched against in a 
case-sensitive way. Default is true.</li>
+  <li><code class="highlighter-rouge">trim</code> - Boolean (Optional). Sets 
whether the expression should be trimmed before matching. Default is true.</li>
+  <li><code class="highlighter-rouge">regexExpression</code> - String 
(Optional). Defines regExp expression as an OGNL expression - will be evaluated 
to String.</li>
+  <li><code class="highlighter-rouge">caseSensitiveExpression</code> - String 
(Optional). Defines <code class="highlighter-rouge">caseSensitive</code> param 
as an OGNL expression - will be evaluated to Boolean.</li>
+  <li><code class="highlighter-rouge">trimExpression</code> - String 
(Optional). Defines trim param as an OGNL expression - will be evaluated to 
Boolean.</li>
+</ul>
 
-<p><strong>(!) Warning</strong></p>
+<p>You can mix normal params with expression aware params but thus was not 
tested.</p>
 
 <blockquote>
-  <table>
-    <tbody>
-      <tr>
-        <td>{snippet:id=parameters-warning</td>
-        <td>javadoc=true</td>
-        
<td>url=com.opensymphony.xwork2.validator.validators.RegexFieldValidator}</td>
-      </tr>
-    </tbody>
-  </table>
+  <p>Warning
+Do not use <code class="highlighter-rouge">${regexExpression}</code>, <code 
class="highlighter-rouge">${caseSensitiveExpression}</code> and <code 
class="highlighter-rouge">${trimExpression}</code> as an expression as this 
will turn into infinitive loop!</p>
 </blockquote>
 
-<p>####Examples####</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code><span 
class="p">{</span><span 
class="err">snippet:id=example|javadoc=true|lang=xml|url=com.opensymphony.xwork2.validator.validators.RegexFieldValidator</span><span
 class="p">}</span><span class="w">
-</span></code></pre>
+<h3 id="examples">Examples</h3>
+
+<div class="highlighter-rouge"><pre class="highlight"><code>&lt;validators&gt;
+    &lt;!-- Plain Validator Syntax --&gt;
+    &lt;validator type="regex"&gt;
+        &lt;param name="fieldName"&gt;myStrangePostcode&lt;/param&gt;
+        &lt;param 
name="regex"&gt;&lt;![CDATA[([aAbBcCdD][123][eEfFgG][456])]]&gt;&lt;/param&gt;
+    &lt;/validator&gt;
+ 
+    &lt;!-- Field Validator Syntax --&gt;
+    &lt;field name="myStrangePostcode"&gt;
+        &lt;field-validator type="regex"&gt;
+            &lt;param 
name="regex"&gt;&lt;![CDATA[([aAbBcCdD][123][eEfFgG][456])]]&gt;&lt;/param&gt;
+        &lt;/field-validator&gt;
+    &lt;/field&gt;
+ 
+    &lt;!-- Field Validator Syntax with expressions --&gt;
+    &lt;field name="myStrangePostcode"&gt;
+        &lt;field-validator type="regex"&gt;
+            &lt;param name="regexExpression"&gt;${regexValue}&lt;/param&gt; 
&lt;!-- will be evaluated as: String getRegexValue() --&gt;
+            &lt;param 
name="caseSensitiveExpression"&gt;${caseSensitiveValue}&lt;/param&gt; &lt;!-- 
will be evaluated as: boolean getCaseSensitiveValue() --&gt;
+            &lt;param name="trimExpression"&gt;${trimValue}&lt;/param&gt; 
&lt;!-- will be evaluated as: boolean getTrimValue() --&gt;
+        &lt;/field-validator&gt;
+    &lt;/field&gt;
+&lt;/validators&gt;
+</code></pre>
 </div>
 
   </section>

http://git-wip-us.apache.org/repos/asf/struts-site/blob/740bd3f6/content/core-developers/short-validator.html
----------------------------------------------------------------------
diff --git a/content/core-developers/short-validator.html 
b/content/core-developers/short-validator.html
index 650be3d..7113dbb 100644
--- a/content/core-developers/short-validator.html
+++ b/content/core-developers/short-validator.html
@@ -127,36 +127,58 @@
     <a class="edit-on-gh" 
href="https://github.com/apache/struts-site/edit/master/source/core-developers/short-validator.md";
 title="Edit this page on GitHub">Edit on GitHub</a>
     <h1 id="short-validator">short validator</h1>
 
-<p>####Description####</p>
+<h3 id="description">Description</h3>
 
-<div class="highlighter-rouge"><pre class="highlight"><code><span 
class="p">{</span><span 
class="err">snippet:id=javadoc|javadoc=true|url=com.opensymphony.xwork2.validator.validators.ShortRangeFieldValidator</span><span
 class="p">}</span><span class="w">
-</span></code></pre>
-</div>
+<p>Field Validator that checks if the short specified is within a certain 
range.</p>
 
-<p>####Parameters####</p>
+<h3 id="parameters">Parameters</h3>
 
-<div class="highlighter-rouge"><pre class="highlight"><code><span 
class="p">{</span><span 
class="err">snippet:id=parameters|javadoc=true|url=com.opensymphony.xwork2.validator.validators.ShortRangeFieldValidator</span><span
 class="p">}</span><span class="w">
-</span></code></pre>
-</div>
+<ul>
+  <li><code class="highlighter-rouge">fieldName</code> - The field name this 
validator is validating. Required if using Plain-Validator Syntax otherwise not 
required.</li>
+  <li><code class="highlighter-rouge">min</code> - the minimum value (if none 
is specified, it will not be checked).</li>
+  <li><code class="highlighter-rouge">max</code> - the maximum value (if none 
is specified, it will not be checked).</li>
+  <li><code class="highlighter-rouge">parse</code> - if set to true, 
minExpression and maxExpression will be evaluated to find min/max.</li>
+  <li><code class="highlighter-rouge">minExpression</code> - expression to 
calculate the minimum value (if none is specified, it will not be checked).</li>
+  <li><code class="highlighter-rouge">maxExpression</code> - expression to 
calculate the maximum value (if none is specified, it will not be checked).</li>
+</ul>
 
-<p><strong>(!) Warning</strong></p>
+<p>You can either use the <code class="highlighter-rouge">min</code> / <code 
class="highlighter-rouge">max</code> value or <code 
class="highlighter-rouge">minExpression</code> / <code 
class="highlighter-rouge">maxExpression</code> (when <code 
class="highlighter-rouge">parse</code> is set to <code 
class="highlighter-rouge">true</code>) - using expression can be slightly 
slower, see the example below.</p>
 
 <blockquote>
-  <table>
-    <tbody>
-      <tr>
-        <td>{snippet:id=parameters-warning</td>
-        <td>javadoc=true</td>
-        
<td>url=com.opensymphony.xwork2.validator.validators.ShortRangeFieldValidator}</td>
-      </tr>
-    </tbody>
-  </table>
+  <p>Warning
+Do not use <code class="highlighter-rouge">${minExpression}</code> and <code 
class="highlighter-rouge">${maxExpression}</code> as an expression as this will 
turn into infinitive loop!</p>
 </blockquote>
 
-<p>####Examples####</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code><span 
class="p">{</span><span 
class="err">snippet:id=example|javadoc=true|lang=xml|url=com.opensymphony.xwork2.validator.validators.ShortRangeFieldValidator</span><span
 class="p">}</span><span class="w">
-</span></code></pre>
+<h3 id="examples">Examples</h3>
+
+<div class="highlighter-rouge"><pre class="highlight"><code>&lt;validators&gt;
+    &lt;!-- Plain Validator Syntax --&gt;
+    &lt;validator type="short"&gt;
+        &lt;param name="fieldName"&gt;age&lt;/param&gt;
+        &lt;param name="min"&gt;20&lt;/param&gt;
+        &lt;param name="max"&gt;50&lt;/param&gt;
+        &lt;message&gt;Age needs to be between ${min} and 
${max}&lt;/message&gt;
+    &lt;/validator&gt;
+ 
+    &lt;!-- Field Validator Syntax --&gt;
+    &lt;field name="age"&gt;
+        &lt;field-validator type="short"&gt;
+            &lt;param name="min"&gt;20&lt;/param&gt;
+            &lt;param name="max"&gt;50&lt;/param&gt;
+            &lt;message&gt;Age needs to be between ${min} and 
${max}&lt;/message&gt;
+        &lt;/field-validator&gt;
+    &lt;/field&gt;
+ 
+    &lt;!-- Field Validator Syntax with expression --&gt;
+    &lt;field name="age"&gt;
+        &lt;field-validator type="short"&gt;
+            &lt;param name="minExpression"&gt;${minValue}&lt;/param&gt; 
&lt;!-- will be evaluated as: Short getMinValue() --&gt;
+            &lt;param name="maxExpression"&gt;${maxValue}&lt;/param&gt; 
&lt;!-- will be evaluated as: Short getMaxValue() --&gt;
+            &lt;message&gt;Age needs to be between ${min} and 
${max}&lt;/message&gt;
+        &lt;/field-validator&gt;
+    &lt;/field&gt;
+&lt;/validators&gt;
+</code></pre>
 </div>
 
   </section>

http://git-wip-us.apache.org/repos/asf/struts-site/blob/740bd3f6/content/core-developers/stringlength-validator.html
----------------------------------------------------------------------
diff --git a/content/core-developers/stringlength-validator.html 
b/content/core-developers/stringlength-validator.html
index 641dd27..3074ce1 100644
--- a/content/core-developers/stringlength-validator.html
+++ b/content/core-developers/stringlength-validator.html
@@ -127,36 +127,60 @@
     <a class="edit-on-gh" 
href="https://github.com/apache/struts-site/edit/master/source/core-developers/stringlength-validator.md";
 title="Edit this page on GitHub">Edit on GitHub</a>
     <h1 id="stringlength-validator">stringlength validator</h1>
 
-<p>####Description####</p>
+<h3 id="description">Description</h3>
 
-<div class="highlighter-rouge"><pre class="highlight"><code><span 
class="p">{</span><span 
class="err">snippet:id=javadoc|javadoc=true|url=com.opensymphony.xwork2.validator.validators.StringLengthFieldValidator</span><span
 class="p">}</span><span class="w">
-</span></code></pre>
-</div>
-
-<p>####Parameters####</p>
+<p>StringLengthFieldValidator checks that a String field is of a certain 
length. If the <code class="highlighter-rouge">minLength</code> parameter is 
specified, it will make sure that the String has at least that many characters. 
If the <code class="highlighter-rouge">maxLength</code> parameter is specified, 
it will make sure that the String has at most that many characters. The <code 
class="highlighter-rouge">trim</code> parameter determines whether it will 
<code class="highlighter-rouge">String#trim()</code> the String before 
performing the length check. If unspecified, the String will be trimmed.</p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code><span 
class="p">{</span><span 
class="err">snippet:id=parameters|javadoc=true|url=com.opensymphony.xwork2.validator.validators.StringLengthFieldValidator</span><span
 class="p">}</span><span class="w">
-</span></code></pre>
-</div>
+<h3 id="parameters">Parameters</h3>
 
-<p><strong>(!) Warning</strong></p>
+<ul>
+  <li><code class="highlighter-rouge">fieldName</code> - The field name this 
validator is validating. Required if using Plain-Validator Syntax otherwise not 
required.</li>
+  <li><code class="highlighter-rouge">maxLength</code> - Integer. The max 
length of the field value. Default ignore.</li>
+  <li><code class="highlighter-rouge">minLength</code> - Integer. The min 
length of the field value. Default ignore.</li>
+  <li><code class="highlighter-rouge">trim</code> - (Optional) Boolean, 
default true. Trim the field value before evaluating its min/max length. 
Default true.</li>
+  <li><code class="highlighter-rouge">maxLengthExpression</code> - (Optional) 
String. Defines the max length param as an OGNL expression.</li>
+  <li><code class="highlighter-rouge">minLengthExpression</code> - (Optional) 
String. Defines the min length param as an OGNL expression.</li>
+  <li><code class="highlighter-rouge">trimExpression</code> - (Optional) 
String. Defines th trim param as an OGNL expression.</li>
+</ul>
 
 <blockquote>
-  <table>
-    <tbody>
-      <tr>
-        <td>{snippet:id=parameters-warning</td>
-        <td>javadoc=true</td>
-        
<td>url=com.opensymphony.xwork2.validator.validators.StringLengthFieldValidator}</td>
-      </tr>
-    </tbody>
-  </table>
+  <p>Warning
+Do not use <code class="highlighter-rouge">${minLengthExpression}</code>, 
<code class="highlighter-rouge">${maxLengthExpression}</code> and <code 
class="highlighter-rouge">${trimExpression}</code> as an expression as this 
will turn into infinitive loop!</p>
 </blockquote>
 
-<p>####Examples####</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code><span 
class="p">{</span><span 
class="err">snippet:id=example|javadoc=true|lang=xml|url=com.opensymphony.xwork2.validator.validators.StringLengthFieldValidator</span><span
 class="p">}</span><span class="w">
-</span></code></pre>
+<h3 id="examples">Examples</h3>
+
+<div class="highlighter-rouge"><pre class="highlight"><code>&lt;validators&gt;
+    &lt;!-- Plain Validator Syntax --&gt;
+    &lt;validator type="stringlength"&gt;
+        &lt;param name="fieldName"&gt;myPurchaseCode&lt;/param&gt;
+        &lt;param name="minLength"&gt;10&lt;/param&gt;
+        &lt;param name="maxLength"&gt;10&lt;/param&gt;
+        &lt;param name="trim"&gt;true&lt;/param&gt;
+        &lt;message&gt;Your purchase code needs to be 10 characters 
long&lt;/message&gt;
+    &lt;/validator&gt;
+ 
+    &lt;!-- Field Validator Syntax --&gt;
+    &lt;field name="myPurchaseCode"&gt;
+        &lt;field-validator type="stringlength"&gt;
+             &lt;param name="minLength"&gt;10&lt;/param&gt;
+             &lt;param name="maxLength"&gt;10&lt;/param&gt;
+             &lt;param name="trim"&gt;true&lt;/param&gt;
+             &lt;message&gt;Your purchase code needs to be 10 characters 
long&lt;/message&gt;
+        &lt;/field-validator&gt;
+    &lt;/field&gt;
+ 
+    &lt;!-- Field Validator Syntax with expression --&gt;
+    &lt;field name="myPurchaseCode"&gt;
+        &lt;field-validator type="stringlength"&gt;
+             &lt;param 
name="minLengthExpression"&gt;${minLengthValue}&lt;/param&gt; &lt;!-- will be 
evaluated as: Integer getMinLengthValue() --&gt;
+             &lt;param 
name="maxLengthExpression"&gt;${maxLengthValue}&lt;/param&gt; &lt;!-- will be 
evaluated as: Integer getMaxLengthValue() --&gt;
+             &lt;param name="trimExpression"&gt;${trimValue}&lt;/param&gt; 
&lt;!-- will be evaluated as: boolean getTrimValue() --&gt;
+             &lt;message&gt;Your purchase code needs to be 10 characters 
long&lt;/message&gt;
+        &lt;/field-validator&gt;
+    &lt;/field&gt;
+&lt;/validators&gt;
+</code></pre>
 </div>
 
   </section>

http://git-wip-us.apache.org/repos/asf/struts-site/blob/740bd3f6/content/core-developers/visitor-validator.html
----------------------------------------------------------------------
diff --git a/content/core-developers/visitor-validator.html 
b/content/core-developers/visitor-validator.html
index 0e9558a..6068c86 100644
--- a/content/core-developers/visitor-validator.html
+++ b/content/core-developers/visitor-validator.html
@@ -127,26 +127,37 @@
     <a class="edit-on-gh" 
href="https://github.com/apache/struts-site/edit/master/source/core-developers/visitor-validator.md";
 title="Edit this page on GitHub">Edit on GitHub</a>
     <h1 id="visitor-validator">visitor validator</h1>
 
-<p>####Description####</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code><span 
class="p">{</span><span 
class="err">snippet:id=javadoc|javadoc=true|url=com.opensymphony.xwork2.validator.validators.VisitorFieldValidator</span><span
 class="p">}</span><span class="w">
-</span></code></pre>
-</div>
-
-<p>####Parameters####</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code><span 
class="p">{</span><span 
class="err">snippet:id=parameters|javadoc=true|url=com.opensymphony.xwork2.validator.validators.VisitorFieldValidator</span><span
 class="p">}</span><span class="w">
-</span></code></pre>
-</div>
-
-<p>####Examples####</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code><span 
class="p">{</span><span 
class="err">snippet:id=example|lang=xml|javadoc=true|url=com.opensymphony.xwork2.validator.validators.VisitorFieldValidator</span><span
 class="p">}</span><span class="w">
-</span></code></pre>
-</div>
-
-<div class="highlighter-rouge"><pre class="highlight"><code><span 
class="p">{</span><span 
class="err">snippet:id=explanation|javadoc=true|url=com.opensymphony.xwork2.validator.validators.VisitorFieldValidator</span><span
 class="p">}</span><span class="w">
-</span></code></pre>
+<h3 id="description">Description</h3>
+
+<p>The VisitorFieldValidator allows you to forward validation to object 
properties of your action using the object’s own validation files. This 
allows you to use the <code class="highlighter-rouge">ModelDriven</code> 
development pattern and manage your validations for your models in one place, 
where they belong, next to your model classes. The VisitorFieldValidator can 
handle either simple Object properties, Collections of Objects, or Arrays.</p>
+
+<h3 id="parameters">Parameters</h3>
+
+<ul>
+  <li><code class="highlighter-rouge">fieldName</code> - field name if 
plain-validator syntax is used, not needed if field-validator syntax is 
used.</li>
+  <li><code class="highlighter-rouge">context</code> - the context of which 
validation should take place. Optional.</li>
+  <li><code class="highlighter-rouge">appendPrefix</code> - the prefix to be 
added to field. Optional.</li>
+</ul>
+
+<h3 id="examples">Examples</h3>
+
+<div class="highlighter-rouge"><pre class="highlight"><code>&lt;validators&gt;
+    &lt;!-- Plain Validator Syntax --&gt;
+    &lt;validator type="visitor"&gt;
+        &lt;param name="fieldName"&gt;user&lt;/param&gt;
+        &lt;param name="context"&gt;myContext&lt;/param&gt;
+        &lt;param name="appendPrefix"&gt;true&lt;/param&gt;
+    &lt;/validator&gt;
+ 
+    &lt;!-- Field Validator Syntax --&gt;
+    &lt;field name="user"&gt;
+       &lt;field-validator type="visitor"&gt;
+          &lt;param name="context"&gt;myContext&lt;/param&gt;
+          &lt;param name="appendPrefix"&gt;true&lt;/param&gt;
+       &lt;/field-validator&gt;
+    &lt;/field&gt;
+&lt;/validators&gt;
+</code></pre>
 </div>
 
   </section>

Reply via email to