[ 
https://issues.apache.org/jira/browse/WW-3478?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13044890#comment-13044890
 ] 

Tom Terrace commented on WW-3478:
---------------------------------

After looking at WW-3559, I realize I may be using the validate method when I 
should be using prepare. It seems much cleaner to put all the lookup calls that 
could throw exceptions into prepare(), and leave the logic to populate 
action/field errors in validate() as Steven said (thanks!).

> Allow exceptions to be thrown from the validate() method
> --------------------------------------------------------
>
>                 Key: WW-3478
>                 URL: https://issues.apache.org/jira/browse/WW-3478
>             Project: Struts 2
>          Issue Type: New Feature
>          Components: Core Actions
>    Affects Versions: 2.2.1
>            Reporter: Tom Terrace
>            Priority: Minor
>         Attachments: validation-exception-patch.txt
>
>
> In the ValidationInterceptor, any exceptions from the validation prefix 
> methods validateXXX and validateDoXXX are rethrown, but we can't throw 
> anything from the plain validate() method.  It would be great to just have 
> one validate method that can fetch the model and throw any security or 
> RecordNotFound exceptions rather than a whole bunch of identical validateXXX 
> methods.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to