re: Custom validation method that returns multiple error messages

2003-04-04 Thread Ted Husted
Off hand, I would say that each of your three rules is probably a 
separate validation. Validations are boolean, pass/fail, creatures. Then 
in the form, you would say that your password field depends on 
rule1,rule2,rule3.

Of course, you can mix and match validations. You can use the validator 
for some and the Struts validate method for others. In the validate 
method, it would be much easier to pick and choose amoung validation 
messages (but you wouldn't get the nifty JavaScript popups).

-Ted.

--
Ted Husted,
Struts in Action http://husted.com/struts/book.html


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Custom validation method that returns multiple error messages

2003-04-03 Thread Moore, Scott R.
Hi all,

I'm using a custom validation method to enforce three rules regarding
passwords.  I would like to be able to display up to three error messages,
but at first glance, the format required for the validator tag in my
custom-validator-rules.xml file only permits one error message:

  !-- Validator for ensuring a password does not contain all or part of
user name --
  validator name=enforceSecurePassword
   classname=gov.sec.lib.validation.Validation
   method=enforceSecurePassword
   methodParams=java.lang.Object,
 org.apache.commons.validator.ValidatorAction,
 org.apache.commons.validator.Field,
 org.apache.struts.action.ActionErrors,
 javax.servlet.http.HttpServletRequest,
 javax.servlet.ServletContext   
   msg=errors.password/
   
Anybody know if there is a way around this?  Or do I have to have separate
custom validation methods to enforce each rule?

Thanks,
Scott Moore
[EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]