This is an automated email from the ASF dual-hosted git repository. lukaszlenart pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/struts-site.git
The following commit(s) were added to refs/heads/master by this push: new b5d72e6 Fixes wrong paths b5d72e6 is described below commit b5d72e6dd174b3d7a8b364857977169bdfc0f758 Author: Lukasz Lenart <lukasz.len...@gmail.com> AuthorDate: Wed Nov 15 06:52:40 2017 +0100 Fixes wrong paths --- source/getting-started/form-validation-using-xml.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/source/getting-started/form-validation-using-xml.md b/source/getting-started/form-validation-using-xml.md index 210e47e..94b97c0 100644 --- a/source/getting-started/form-validation-using-xml.md +++ b/source/getting-started/form-validation-using-xml.md @@ -26,9 +26,9 @@ __Validation Using XML__ To validate a user's form field entries you can use a separate XML file that contains your validation rules. 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). -Struts 2 provides several different validators that you can use in the XML validation file. See [Validation](//struts.apache.org/docs/validation.html) for a list of validators you can employ. +Struts 2 provides several different validators that you can use in the XML validation file. See [Validation](../core-developers/validation.html) for a list of validators you can employ. -In the above form, we want to ensure the user enters a first name. To have the Struts 2 framework enforce that rule we can used the Struts 2 [requiredstring validator](//struts.apache.org/docs/requiredstring-validator.html). This validator checks that the user has entered a string value in the form field. +In the above form, we want to ensure the user enters a first name. To have the Struts 2 framework enforce that rule we can used the Struts 2 [requiredstring validator](../core-developers/requiredstring-validator.html). This validator checks that the user has entered a string value in the form field. __XML Validator Format__ @@ -47,9 +47,9 @@ In the XML validation file (for this example that is EditAction-validation.xml), </validators> ``` -Within the validators node you can have 1 or more validator nodes. The type attribute specifies which validator you want the Struts 2 framework to use (see [Validation](//struts.apache.org/docs/validation.html) ). The param name="fieldname" node is used to tell the framework which form field entry to apply the rule to. See edit.jsp for the form fields and their name value (review [Struts 2 Form Tags](form-tags.html) if you're not familiar with how to use Struts 2 form tags). The message [...] +Within the validators node you can have 1 or more validator nodes. The type attribute specifies which validator you want the Struts 2 framework to use (see [Validation](../core-developers/validation.html) ). The param name="fieldname" node is used to tell the framework which form field entry to apply the rule to. See edit.jsp for the form fields and their name value (review [Struts 2 Form Tags](form-tags.html) if you're not familiar with how to use Struts 2 form tags). The message node i [...] -| There are alternate ways to write the XML that goes in the validation XML file. See [Validation](//struts.apache.org/docs/validation.html) in the Struts 2 documentation for a full discussion. +| There are alternate ways to write the XML that goes in the validation XML file. See [Validation](../core-developers/validation.html) in the Struts 2 documentation for a full discussion. For example if the user doesn't enter a value in the first name form field and clicks on the Save Changes button, he will see the following. @@ -57,7 +57,7 @@ For example if the user doesn't enter a value in the first name form field and c __Validating An Email Address__ -You can use the Struts 2 [email validator](//struts.apache.org/docs/email-validator.html) to validate the user's input in the email field. Here is the validator node that is in the `EditAction-validation.xml` file. +You can use the Struts 2 [email validator](../core-developers/email-validator.html) to validate the user's input in the email field. Here is the validator node that is in the `EditAction-validation.xml` file. **Email Validator** @@ -76,7 +76,7 @@ Note that in the example, we are requiring the user to enter an email address an __Validating A User's Input Using A Regular Expression__ -The Struts 2 framework provides a powerful way to validate a user's form field input by using the [regex validator](//struts.apache.org/docs/regex-validator.html) . In the example application, we want to ensure the user enters the phone number in the format 999-999-9999. We can use a regular expression and the [regex validator](//struts.apache.org/docs/regex-validator.html) to enforce this rule. +The Struts 2 framework provides a powerful way to validate a user's form field input by using the [regex validator](../core-developers/regex-validator.html) . In the example application, we want to ensure the user enters the phone number in the format 999-999-9999. We can use a regular expression and the [regex validator](../core-developers/regex-validator.html) to enforce this rule. **REGEX Validator** @@ -96,7 +96,7 @@ The param name="expression" node is used to specify the regular expression that __Validating A User's Input Using An OGNL Expression__ -In the example application, we want to ensure the user checks at least one of the car model check boxes. To enforce this rule we can use the [fieldexpression validator](//struts.apache.org/docs/fieldexpression-validator.html) . Here's the XML for that validator node. +In the example application, we want to ensure the user checks at least one of the car model check boxes. To enforce this rule we can use the [fieldexpression validator](../core-developers/fieldexpression-validator.html) . Here's the XML for that validator node. **FieldExpression Validator** @@ -108,7 +108,7 @@ In the example application, we want to ensure the user checks at least one of th </validator> ``` -The param name="expression" node contains an OGNL expression that evaluates to true or false. We haven't previously discussed OGNL, which stands for Object-Graph Navigation Language (see [http://www.opensymphony.com/ognl/](http://www.opensymphony.com/ognl/) and [OGNL](//struts.apache.org/docs/ognl.html) ). OGNL expressions can be evaluated by the Struts 2 framework as Java statements. +The param name="expression" node contains an OGNL expression that evaluates to true or false. We haven't previously discussed OGNL, which stands for Object-Graph Navigation Language (see [https://github.com/jkuhnert/ognl](https://github.com/jkuhnert/ognl) and [OGNL](../core-developers/ognl.html) ). OGNL expressions can be evaluated by the Struts 2 framework as Java statements. In the above XML the value of the param name="expression" node, personBean.carModels.length \> 0, will be evaluated by the framework as a Java statement. The part personBean.carModels tells the framework to call the getCarModels method of class Person. That method returns an Array. Since class Array has a length attribute, the framework will get the value of the length attribute of the Array returned by the getCarModels method. -- To stop receiving notification emails like this one, please contact ['"commits@struts.apache.org" <commits@struts.apache.org>'].