Repository: struts-site
Updated Branches:
  refs/heads/asf-site 5fe99b224 -> 0898ed78f


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/0898ed78
Tree: http://git-wip-us.apache.org/repos/asf/struts-site/tree/0898ed78
Diff: http://git-wip-us.apache.org/repos/asf/struts-site/diff/0898ed78

Branch: refs/heads/asf-site
Commit: 0898ed78f845d543350dd723e3d1dd3cb59d38bb
Parents: 5fe99b2
Author: jenkins <bui...@apache.org>
Authored: Sun Sep 10 21:31:32 2017 +0000
Committer: jenkins <bui...@apache.org>
Committed: Sun Sep 10 21:31:32 2017 +0000

----------------------------------------------------------------------
 .../core-developers/conversion-validator.html   | 92 +++++++++++++++-----
 content/core-developers/date-validator.html     | 68 ++++++++++-----
 content/core-developers/double-validator.html   | 69 ++++++++++-----
 content/core-developers/required-validator.html | 45 ++++++----
 .../requiredstring-validator.html               | 55 ++++++++----
 5 files changed, 230 insertions(+), 99 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts-site/blob/0898ed78/content/core-developers/conversion-validator.html
----------------------------------------------------------------------
diff --git a/content/core-developers/conversion-validator.html 
b/content/core-developers/conversion-validator.html
index c55533c..80f38db 100644
--- a/content/core-developers/conversion-validator.html
+++ b/content/core-developers/conversion-validator.html
@@ -127,44 +127,90 @@
     <a class="edit-on-gh" 
href="https://github.com/apache/struts-site/edit/master/source/core-developers/conversion-validator.md";
 title="Edit this page on GitHub">Edit on GitHub</a>
     <h1 id="conversion-validator">conversion 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.ConversionErrorFieldValidator</span><span
 class="p">}</span><span class="w">
-</span></code></pre>
-</div>
+<p>Field Validator that checks if a conversion error occurred for this 
field.</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.ConversionErrorFieldValidator</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>
+</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.ConversionErrorFieldValidator</span><span
 class="p">}</span><span class="w">
-</span></code></pre>
+<div class="highlighter-rouge"><pre class="highlight"><code>&lt;!-- Plain 
Validator Syntax --&gt;
+&lt;validator type="conversion"&gt;
+        &lt;param name="fieldName"&gt;myField&lt;/param&gt;
+     &lt;message&gt;Conversion Error Occurred&lt;/message&gt;
+&lt;/validator&gt;
+  
+&lt;!-- Field Validator Syntax --&gt;
+&lt;field name="myField"&gt;
+   &lt;field-validator type="conversion"&gt;
+      &lt;message&gt;Conversion Error Occurred&lt;/message&gt;
+   &lt;/field-validator&gt;
+&lt;/field&gt;
+</code></pre>
 </div>
 
-<p>####Repopulating Field upon conversion Error####</p>
+<h3 id="repopulating-field-upon-conversion-error">Repopulating Field upon 
conversion Error</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.RepopulateConversionErrorFieldValidatorSupport</span><span
 class="p">}</span><span class="w">
-</span></code></pre>
-</div>
+<p>The capability of auto-repopulating the stack with a fake parameter map 
when a conversion error has occurred can be done with <code 
class="highlighter-rouge">repopulateField</code> property set to <code 
class="highlighter-rouge">true</code>.</p>
+
+<p>This is typically useful when one wants to repopulate the field with the 
original value when a conversion error occurred. Eg. with a textfield that only 
allows an Integer (the action class have an Integer field declared), upon 
conversion error, the incorrectly entered integer (maybe a text ‘one’) will 
not appear when dispatched back. With <code 
class="highlighter-rouge">repopulateField</code> property set to true, it will, 
meaning the textfield will have ‘one’ as its value upon conversion 
error.</p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code><span 
class="p">{</span><span 
class="err">snippet:id=exampleJspPage|lang=xml|javadoc=true|url=com.opensymphony.xwork2.validator.validators.RepopulateConversionErrorFieldValidatorSupport</span><span
 class="p">}</span><span class="w">
-</span></code></pre>
+<div class="highlighter-rouge"><pre class="highlight"><code>&lt;!-- 
myJspPage.jsp --&gt;
+&lt;s:form action="someAction" method="POST"&gt;
+  ....
+  &lt;s:textfield label="My Integer Field" name="myIntegerField" /&gt;
+  ....
+  &lt;s:submit /&gt;
+&lt;/s:form&gt;
+</code></pre>
 </div>
 
-<div class="highlighter-rouge"><pre class="highlight"><code><span 
class="p">{</span><span 
class="err">snippet:id=exampleXwork|lang=xml|javadoc=true|url=com.opensymphony.xwork2.validator.validators.RepopulateConversionErrorFieldValidatorSupport</span><span
 class="p">}</span><span class="w">
-</span></code></pre>
+<div class="highlighter-rouge"><pre class="highlight"><code>&lt;!-- xwork.xml 
--&gt;
+&lt;xwork&gt;
+&lt;include file="xwork-default.xml" /&gt;
+....
+&lt;package name="myPackage" extends="xwork-default"&gt;
+  ....
+  &lt;action name="someAction" class="example.MyActionSupport.java"&gt;
+     &lt;result name="input"&gt;myJspPage.jsp&lt;/result&gt;
+     &lt;result&gt;success.jsp&lt;/result&gt;
+  &lt;/action&gt;
+  ....
+&lt;/package&gt;
+....
+&lt;/xwork&gt;
+</code></pre>
 </div>
 
-<div class="highlighter-rouge"><pre class="highlight"><code><span 
class="p">{</span><span 
class="err">snippet:id=exampleJava|lang=java|javadoc=true|url=com.opensymphony.xwork2.validator.validators.RepopulateConversionErrorFieldValidatorSupport</span><span
 class="p">}</span><span class="w">
-</span></code></pre>
+<div class="highlighter-rouge"><pre class="highlight"><code>&lt;!-- 
MyActionSupport.java --&gt;
+public class MyActionSupport extends ActionSupport {
+   private Integer myIntegerField;
+ 
+   public Integer getMyIntegerField() { return this.myIntegerField; }
+   public void setMyIntegerField(Integer myIntegerField) {
+      this.myIntegerField = myIntegerField;
+   }
+}
+</code></pre>
 </div>
 
-<div class="highlighter-rouge"><pre class="highlight"><code><span 
class="p">{</span><span 
class="err">snippet:id=exampleValidation|lang=xml|javadoc=true|url=com.opensymphony.xwork2.validator.validators.RepopulateConversionErrorFieldValidatorSupport</span><span
 class="p">}</span><span class="w">
-</span></code></pre>
+<div class="highlighter-rouge"><pre class="highlight"><code>&lt;!-- 
MyActionSupport-someAction-validation.xml --&gt;
+&lt;validators&gt;
+  ...
+  &lt;field name="myIntegerField"&gt;
+     &lt;field-validator type="conversion"&gt;
+        &lt;param name="repopulateField"&gt;true&lt;/param&gt;
+        &lt;message&gt;Conversion Error (Integer Wanted)&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/0898ed78/content/core-developers/date-validator.html
----------------------------------------------------------------------
diff --git a/content/core-developers/date-validator.html 
b/content/core-developers/date-validator.html
index 09c1f02..87fa0c9 100644
--- a/content/core-developers/date-validator.html
+++ b/content/core-developers/date-validator.html
@@ -127,36 +127,60 @@
     <a class="edit-on-gh" 
href="https://github.com/apache/struts-site/edit/master/source/core-developers/date-validator.md";
 title="Edit this page on GitHub">Edit on GitHub</a>
     <h1 id="date-validator">date 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.DateRangeFieldValidator</span><span
 class="p">}</span><span class="w">
-</span></code></pre>
-</div>
+<p>Field Validator that checks if the date supplied is within a specific 
range.</p>
 
-<p>####Parameters####</p>
+<p><strong>NOTE:</strong> If no date converter is specified, <code 
class="highlighter-rouge">XWorkBasicConverter</code> will kick in to do the 
date conversion, which by default using the <code 
class="highlighter-rouge">Date.SHORT</code> format using the a problematically 
specified locale else falling back to the system default locale.</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.DateRangeFieldValidator</span><span
 class="p">}</span><span class="w">
-</span></code></pre>
-</div>
+<h3 id="parameters">Parameters</h3>
 
-<p><strong>(!) Warning</strong></p>
+<ul>
+  <li>`fieldName - 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 min date range. If not 
specified will not be checked.</li>
+  <li><code class="highlighter-rouge">max</code> - the max date range. If not 
specified 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>You can either use the min / max value or minExpression / maxExpression 
(when parse is set to true) - 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.DateRangeFieldValidator}</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.DateRangeFieldValidator</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="date"&gt;
+        &lt;param name="fieldName"&gt;birthday&lt;/param&gt;
+        &lt;param name="min"&gt;01/01/1990&lt;/param&gt;
+        &lt;param name="max"&gt;01/01/2000&lt;/param&gt;
+        &lt;message&gt;Birthday must be within ${min} and 
${max}&lt;/message&gt;
+    &lt;/validator&gt;
+ 
+    &lt;!-- Field Validator Syntax --&gt;
+    &lt;field name="birthday"&gt;
+        &lt;field-validator type="date"&gt;
+            &lt;param name="min"&gt;01/01/1990&lt;/param&gt;
+            &lt;param name="max"&gt;01/01/2000&lt;/param&gt;
+            &lt;message&gt;Birthday must be within ${min} and 
${max}&lt;/message&gt;
+        &lt;/field-validator&gt;
+    &lt;/field&gt;
+ 
+    &lt;!-- Field Validator Syntax with expression --&gt;
+    &lt;field name="birthday"&gt;
+        &lt;field-validator type="date"&gt;
+            &lt;param name="minExpression"&gt;${minValue}&lt;/param&gt; 
&lt;!-- will be evaluated as: Date getMinValue() --&gt;
+            &lt;param name="maxExpression"&gt;${maxValue}&lt;/param&gt; 
&lt;!-- will be evaluated as: Date 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/0898ed78/content/core-developers/double-validator.html
----------------------------------------------------------------------
diff --git a/content/core-developers/double-validator.html 
b/content/core-developers/double-validator.html
index ca13a2c..a5ac7f2 100644
--- a/content/core-developers/double-validator.html
+++ b/content/core-developers/double-validator.html
@@ -127,36 +127,61 @@
     <a class="edit-on-gh" 
href="https://github.com/apache/struts-site/edit/master/source/core-developers/double-validator.md";
 title="Edit this page on GitHub">Edit on GitHub</a>
     <h1 id="double-validator">double 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.DoubleRangeFieldValidator</span><span
 class="p">}</span><span class="w">
-</span></code></pre>
-</div>
+<p>Field Validator that checks if the double 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.DoubleRangeFieldValidator</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">minInclusive</code> - the minimum 
inclusive value in FloatValue format specified by Java language (if none is 
specified, it will not be checked).</li>
+  <li><code class="highlighter-rouge">maxInclusive</code> - the maximum 
inclusive value in FloatValue format specified by Java language (if none is 
specified, it will not be checked).</li>
+  <li><code class="highlighter-rouge">minExclusive</code> - the minimum 
exclusive value in FloatValue format specified by Java language (if none is 
specified, it will not be checked).</li>
+  <li><code class="highlighter-rouge">maxExclusive</code> - the maximum 
exclusive value in FloatValue format specified by Java language (if none is 
specified, it will not be checked).</li>
+  <li><code class="highlighter-rouge">minInclusiveExpression</code> - the 
minimum inclusive value specified as a OGNL expression (if none is specified, 
it will not be checked).</li>
+  <li><code class="highlighter-rouge">maxInclusiveExpression</code> - the 
maximum inclusive value specified as a OGNL expression (if none is specified, 
it will not be checked).</li>
+  <li><code class="highlighter-rouge">minExclusiveExpression</code> - the 
minimum exclusive value specified as a OGNL expression (if none is specified, 
it will not be checked).</li>
+  <li><code class="highlighter-rouge">maxExclusiveExpression</code> - the 
maximum exclusive value specified as a OGNL expression (if none is specified, 
it will not be checked).</li>
+</ul>
 
-<p><strong>(!) Warning</strong></p>
+<p>You can specify either <code class="highlighter-rouge">minInclusive</code>, 
<code class="highlighter-rouge">maxInclusive</code>, <code 
class="highlighter-rouge">minExclusive</code> and <code 
class="highlighter-rouge">maxExclusive</code> or <code 
class="highlighter-rouge">minInclusiveExpression</code>, <code 
class="highlighter-rouge">maxInclusiveExpression</code>, <code 
class="highlighter-rouge">minExclusiveExpression</code> and <code 
class="highlighter-rouge">maxExclusiveExpression</code> as a OGNL expression, 
see example below. You can always try to mix params but be aware that such 
behaviour 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.DoubleRangeFieldValidator}</td>
-      </tr>
-    </tbody>
-  </table>
+  <p>Warning
+Do not use <code class="highlighter-rouge">${minInclusiveExpression}</code>, 
<code class="highlighter-rouge">${maxInclusiveExpression}</code>, <code 
class="highlighter-rouge">${minExclusiveExpressionExpression}</code> and <code 
class="highlighter-rouge">${maxExclusive}</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.DoubleRangeFieldValidator</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="double"&gt;
+        &lt;param name="fieldName"&gt;percentage&lt;/param&gt;
+        &lt;param name="minInclusive"&gt;20.1&lt;/param&gt;
+        &lt;param name="maxInclusive"&gt;50.1&lt;/param&gt;
+        &lt;message&gt;Age needs to be between ${minInclusive} and 
${maxInclusive} (inclusive)&lt;/message&gt;
+    &lt;/validator&gt;
+ 
+    &lt;!-- Field Validator Syntax --&gt;
+    &lt;field name="percentage"&gt;
+        &lt;field-validator type="double"&gt;
+            &lt;param name="minExclusive"&gt;0.123&lt;/param&gt;
+            &lt;param name="maxExclusive"&gt;99.98&lt;/param&gt;
+            &lt;message&gt;Percentage needs to be between ${minExclusive} and 
${maxExclusive} (exclusive)&lt;/message&gt;
+        &lt;/field-validator&gt;
+    &lt;/field&gt;
+ 
+    &lt;!-- Field Validator Syntax with expression --&gt;
+    &lt;field name="percentage"&gt;
+        &lt;field-validator type="double"&gt;
+            &lt;param 
name="minExclusiveExpression"&gt;${minExclusiveValue}&lt;/param&gt; &lt;!-- 
will be evaluated as: Double getMinExclusiveValue() --&gt;
+            &lt;param 
name="maxExclusiveExpression"&gt;${maxExclusiveValue}&lt;/param&gt; &lt;!-- 
will be evaluated as: Double getMaxExclusiveValue() --&gt;
+            &lt;message&gt;Percentage needs to be between ${minExclusive} and 
${maxExclusive} (exclusive)&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/0898ed78/content/core-developers/required-validator.html
----------------------------------------------------------------------
diff --git a/content/core-developers/required-validator.html 
b/content/core-developers/required-validator.html
index 8bdf190..705ce76 100644
--- a/content/core-developers/required-validator.html
+++ b/content/core-developers/required-validator.html
@@ -127,22 +127,35 @@
     <a class="edit-on-gh" 
href="https://github.com/apache/struts-site/edit/master/source/core-developers/required-validator.md";
 title="Edit this page on GitHub">Edit on GitHub</a>
     <h1 id="required-validator">required 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.RequiredFieldValidator</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.RequiredFieldValidator</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.RequiredFieldValidator</span><span
 class="p">}</span><span class="w">
-</span></code></pre>
+<h3 id="description">Description</h3>
+
+<p>RequiredFieldValidator checks if the specified field is not null.</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>
+</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="required"&gt;
+        &lt;param name="fieldName"&gt;username&lt;/param&gt;
+        &lt;message&gt;username must not be null&lt;/message&gt;
+    &lt;/validator&gt;
+ 
+ 
+    &lt;!-- Field Validator Syntax --&gt;
+    &lt;field name="username"&gt;
+        &lt;field-validator type="required"&gt;
+               &lt;message&gt;username must not be null&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/0898ed78/content/core-developers/requiredstring-validator.html
----------------------------------------------------------------------
diff --git a/content/core-developers/requiredstring-validator.html 
b/content/core-developers/requiredstring-validator.html
index 4d0ba17..a418982 100644
--- a/content/core-developers/requiredstring-validator.html
+++ b/content/core-developers/requiredstring-validator.html
@@ -127,22 +127,45 @@
     <a class="edit-on-gh" 
href="https://github.com/apache/struts-site/edit/master/source/core-developers/requiredstring-validator.md";
 title="Edit this page on GitHub">Edit on GitHub</a>
     <h1 id="requiredstring-validator">requiredstring 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.RequiredStringValidator</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.RequiredStringValidator</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=examples|lang=xml|javadoc=true|url=com.opensymphony.xwork2.validator.validators.RequiredStringValidator</span><span
 class="p">}</span><span class="w">
-</span></code></pre>
+<h3 id="description">Description</h3>
+
+<p>RequiredStringValidator checks that a String field is non-null and has a 
length &gt; 0. (i.e. it isn’t “”). 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>
+
+<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">trim</code> - (Optional) Boolean, 
default true. Trims the field name value before validating.</li>
+  <li><code class="highlighter-rouge">trimExpression</code> - (Optional) 
String. Specifies the trim param as an OGNL expression.</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="requiredstring"&gt;
+        &lt;param name="fieldName"&gt;username&lt;/param&gt;
+        &lt;param name="trim"&gt;true&lt;/param&gt;
+        &lt;message&gt;username is required&lt;/message&gt;
+    &lt;/validator&gt;
+     
+    &lt;!-- Field-Validator Syntax --&gt;
+    &lt;field name="username"&gt;
+        &lt;field-validator type="requiredstring"&gt;
+            &lt;param name="trim"&gt;true&lt;/param&gt;
+            &lt;message&gt;username is required&lt;/message&gt;
+        &lt;/field-validator&gt;
+    &lt;/field&gt;
+ 
+    &lt;!-- Field-Validator Syntax with expression --&gt;
+    &lt;field name="username"&gt;
+        &lt;field-validator type="requiredstring"&gt;
+            &lt;param name="trimExpression"&gt;${trimValue}&lt;/param&gt; 
&lt;!-- will be evaluated as: boolean getTrimValue() --&gt;
+            &lt;message&gt;username is required&lt;/message&gt;
+        &lt;/field-validator&gt;
+    &lt;/field&gt;
+&lt;/validators&gt;
+</code></pre>
 </div>
 
   </section>

Reply via email to