SPRNET-1081 - Add an ExceptionThrowingAction to Spring.Validation framework

This commit is contained in:
markpollack
2009-07-30 03:32:45 +00:00
parent bba99bbbaf
commit e842673936
12 changed files with 900 additions and 447 deletions

View File

@@ -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>&lt;v:exception/&gt;</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>&lt;v:exception throw='new System.InvalidOperationException("invalid")'/&gt;</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.