You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Matthias Bauer <Ma...@livinglogic.de> on 2002/12/03 07:44:56 UTC

Re: Form validation with Struts Workflow

Richard,

in the action mapping you can specify the attribute "validate". This 
attribute defaults to true in the ActionMapping class. With the Struts 
Workflow Extension the class ApplicationMapping is used instead of 
ActionMapping. In this class "validate" defaults to false. Thus, if you 
want to switch automatic validation on, you explicitly have to specify  
validate="true" in each action definition.

However, I recommend to do without automatic form validation, when using 
the struts-workflow extension. Here is why:

1. Due to the current implementation of struts and the workflow 
extension, the form validation is done, before authentication and 
workflow has been checked. This is not what you want, because 
authentication and workflow needs to be checked first.

2. You can always call the form.validate() method from the action 
yourself, which I believe is the much better approach anyway, because 
most often you need some additional information from an external data 
source to validate the input (e. g. a password). Obtaining information 
from external data sources should always be done in the action classes, 
not in the form beans.

If I remember correctly, there is no technical reason why automatic form 
validation can not be supported. It should be a minor change to 
eliminate reason (1) in the code. So please let me know, if you really 
need it. I should soon be able to provide a changed version.

--- Matthias


PS: I cc'ed to the struts user list, because conversations like this 
might be relevant to other worklow users, too.



Richard Grossman wrote:

> Hi,
>  
> I'm starting to work using Struts Workflow but I'm confronted to a big 
> problem.
> It seem that using the workflow the validate method inside ActionForm 
> are not called !?!
> is there any configuration or else to enabled this ?
>  
> Thanks for your help
>  
> Richard Grossman





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>