SPRNET-1081 - Add an ExceptionThrowingAction to Spring.Validation framework
This commit is contained in:
@@ -565,6 +565,22 @@
|
||||
</itemizedlist>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Exception Action</title>
|
||||
|
||||
<para>If you would like an exception to be thrown when validation fails
|
||||
use the exception action.</para>
|
||||
|
||||
<programlisting><v:exception/></programlisting>
|
||||
|
||||
<para>This will throw an exception of the type ValidationException and
|
||||
you can access error information via its ValidationErrors property. To
|
||||
throw your own custom exception, provide a SpEL fragment that
|
||||
instantiates the custom exception.</para>
|
||||
|
||||
<programlisting><v:exception throw='new System.InvalidOperationException("invalid")'/></programlisting>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Generic Actions</title>
|
||||
|
||||
@@ -888,7 +904,7 @@ bool userInfoIsValid = userInfoValidator.Validate(userInfo, errors);
|
||||
<section>
|
||||
<title>How Validate() and Validation Controls play together</title>
|
||||
|
||||
<para> Validation Controls (ValidationSummary, ValidationError) need to
|
||||
<para>Validation Controls (ValidationSummary, ValidationError) need to
|
||||
somehow get the list of errors collected during validation. Both,
|
||||
Spring.Web.UI.Page and Spring.Web.UI.UserControl come with a
|
||||
ValidationErrors property and implement IValidationContainer.
|
||||
|
||||
Reference in New Issue
Block a user