i have defined a DynaValidatorActionBean and a Action Class with extends DispatchAction. in the Action class there are the methods
– prepareAdd (forwards to edit.jsp)
– prepareEdit (forwards also to edit.jsp but gets chosen userinfos from database)
– save (saves user)
in the struts-config.xml there is an action-mapping where validate is true and the input source is edit.jsp.
the edit.jsp is the add AND edit site with logic tags to choose if it is an edit or add action.
and i have defined a validation rule in my validators validation.xml
now the problem: everytime i call the edit or add action the validator is executed. even BEFORE i have inserted some values. that happens because the Action Class is meant to be validated. but i don’t want the prepareAdd and prepareEdit functions to be validated only when save is executed i hope its a bit clear what i mean.
the problem is that error messages show up even if i just have called the site to edit.
can someone gve me a solution how i have to organize my action-mappings and so on…. or do i find the solution at the validation configuration?!??