Repository: struts-site Updated Branches: refs/heads/asf-site 0898ed78f -> 073acc782
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/073acc78 Tree: http://git-wip-us.apache.org/repos/asf/struts-site/tree/073acc78 Diff: http://git-wip-us.apache.org/repos/asf/struts-site/diff/073acc78 Branch: refs/heads/asf-site Commit: 073acc782e97e114acdefe182e7d2db1dca26568 Parents: 0898ed7 Author: jenkins <bui...@apache.org> Authored: Sun Sep 10 21:47:44 2017 +0000 Committer: jenkins <bui...@apache.org> Committed: Sun Sep 10 21:47:44 2017 +0000 ---------------------------------------------------------------------- content/core-developers/date-validator.html | 4 +- .../core-developers/expression-validator.html | 25 ++++---- content/core-developers/int-validator.html | 66 +++++++++++++------- content/core-developers/required-validator.html | 1 - content/core-developers/url-validator.html | 21 +++---- 5 files changed, 67 insertions(+), 50 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/struts-site/blob/073acc78/content/core-developers/date-validator.html ---------------------------------------------------------------------- diff --git a/content/core-developers/date-validator.html b/content/core-developers/date-validator.html index 87fa0c9..177b5c6 100644 --- a/content/core-developers/date-validator.html +++ b/content/core-developers/date-validator.html @@ -136,7 +136,7 @@ <h3 id="parameters">Parameters</h3> <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">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 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> @@ -144,7 +144,7 @@ <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> +<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> <p>Warning http://git-wip-us.apache.org/repos/asf/struts-site/blob/073acc78/content/core-developers/expression-validator.html ---------------------------------------------------------------------- diff --git a/content/core-developers/expression-validator.html b/content/core-developers/expression-validator.html index 491c3fa..cd26753 100644 --- a/content/core-developers/expression-validator.html +++ b/content/core-developers/expression-validator.html @@ -127,22 +127,25 @@ <a class="edit-on-gh" href="https://github.com/apache/struts-site/edit/master/source/core-developers/expression-validator.md" title="Edit this page on GitHub">Edit on GitHub</a> <h1 id="expression-validator">expression 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.ExpressionValidator</span><span class="p">}</span><span class="w"> -</span></code></pre> -</div> +<p>A Non-Field Level validator that validates based on regular expression supplied.</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.ExpressionValidator</span><span class="p">}</span><span class="w"> -</span></code></pre> -</div> +<ul> + <li><code class="highlighter-rouge">expression</code> - the Ognl expression to be evaluated against the stack (Must evaluate to a Boolean).</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.ExpressionValidator</span><span class="p">}</span><span class="w"> -</span></code></pre> +<div class="highlighter-rouge"><pre class="highlight"><code><validators> + <validator type="expression"> + <param name="expression"> .... </param> + <message>Failed to meet Ognl Expression .... </message> + </validator> +</validators> +</code></pre> </div> </section> http://git-wip-us.apache.org/repos/asf/struts-site/blob/073acc78/content/core-developers/int-validator.html ---------------------------------------------------------------------- diff --git a/content/core-developers/int-validator.html b/content/core-developers/int-validator.html index 789c0cd..7dc1bd8 100644 --- a/content/core-developers/int-validator.html +++ b/content/core-developers/int-validator.html @@ -127,36 +127,58 @@ <a class="edit-on-gh" href="https://github.com/apache/struts-site/edit/master/source/core-developers/int-validator.md" title="Edit this page on GitHub">Edit on GitHub</a> <h1 id="int-validator">int 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.IntRangeFieldValidator</span><span class="p">}</span><span class="w"> -</span></code></pre> -</div> +<p>Field Validator that checks if the integer 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.IntRangeFieldValidator</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.IntRangeFieldValidator}</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.IntRangeFieldValidator</span><span class="p">}</span><span class="w"> -</span></code></pre> +<h3 id="examples">Examples</h3> + +<div class="highlighter-rouge"><pre class="highlight"><code><validators> + <!-- Plain Validator Syntax --> + <validator type="int"> + <param name="fieldName">age</param> + <param name="min">20</param> + <param name="max">50</param> + <message>Age needs to be between ${min} and ${max}</message> + </validator> + + <!-- Field Validator Syntax --> + <field name="age"> + <field-validator type="int"> + <param name="min">20</param> + <param name="max">50</param> + <message>Age needs to be between ${min} and ${max}</message> + </field-validator> + </field> + + <!-- Field Validator Syntax with expression --> + <field name="age"> + <field-validator type="int"> + <param name="minExpression">${minValue}</param> <!-- will be evaluated as: Integer getMinValue() --> + <param name="maxExpression">${maxValue}</param> <!-- will be evaluated as: Integer getMaxValue() --> + <message>Age needs to be between ${min} and ${max}</message> + </field-validator> + </field> +</validators> +</code></pre> </div> </section> http://git-wip-us.apache.org/repos/asf/struts-site/blob/073acc78/content/core-developers/required-validator.html ---------------------------------------------------------------------- diff --git a/content/core-developers/required-validator.html b/content/core-developers/required-validator.html index 705ce76..16ae3c0 100644 --- a/content/core-developers/required-validator.html +++ b/content/core-developers/required-validator.html @@ -153,7 +153,6 @@ <message>username must not be null</message> </field-validator> </field> - </validators> </code></pre> </div> http://git-wip-us.apache.org/repos/asf/struts-site/blob/073acc78/content/core-developers/url-validator.html ---------------------------------------------------------------------- diff --git a/content/core-developers/url-validator.html b/content/core-developers/url-validator.html index 54e2be1..5892291 100644 --- a/content/core-developers/url-validator.html +++ b/content/core-developers/url-validator.html @@ -127,25 +127,19 @@ <a class="edit-on-gh" href="https://github.com/apache/struts-site/edit/master/source/core-developers/url-validator.md" title="Edit this page on GitHub">Edit on GitHub</a> <h1 id="url-validator">url validator</h1> -<p>####Description####</p> +<h3 id="description">Description</h3> -<p>URLValidator checks that a given field is a String and a valid URL</p> +<p>URLValidator checks that a given field is a String and a valid URL.</p> -<p>Parameters</p> +<h3 id="parameters">Parameters</h3> <ul> - <li> - <p>fieldName - The field name this validator is validating. Required if using Plain-Validator Syntax otherwise not required</p> - </li> - <li> - <p>urlRegexExpression - The regex defined as expression used to validate url. If not defined âurlRegexâ will be used instead</p> - </li> - <li> - <p>urlRegex - The regex used to validate url. If not defined default regex will be used</p> - </li> + <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">urlRegexExpression</code> - The regex defined as expression used to validate url. If not defined âurlRegexâ will be used instead.</li> + <li><code class="highlighter-rouge">urlRegex</code> - The regex used to validate url. If not defined default regex will be used.</li> </ul> -<p>####Examples####</p> +<h3 id="examples">Examples</h3> <div class="highlighter-rouge"><pre class="highlight"><code><validators> <!-- Plain Validator Syntax --> @@ -161,7 +155,6 @@ </field-validator> </field> </validators> - </code></pre> </div>