"Deadman, Hal" wrote:
 I have a form where I call the following (where UserForm.MIN_PASSWORD_LENGTH is an int):errors.add("password", new ActionError("error.user.passwordinvalid", String.valueOf(UserForm.MIN_PASSWORD_LENGTH)));which references this in the ApplicationResource.properties file:error.user.passwordinvalid=<li>The password must contain at least {0} characters.</li> But the html:error tag displays this:
  • The password must contain at least [Ljava.lang.Object;@14f467 characters.
  •  I could have sworn that this used to work but it doesn't anymore for me. Does passing parameters to ActionError objects still work for everyone with recent builds? If it still works then I must have broke something. Thanks, Hal


    You should be able to pass the length as an object of type Integer, and let the message formatting methods worry about converting it to a String:

        errors.add("password", new ActionError("error.user.passwordinvalid",
            new Integer(UserForm.MIN_PASSWORD_LENGTH));

    The parameter values are all Objects rather than Strings.

    Craig
     

    Reply via email to