You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dimitris Mouchritsas <di...@eurodyn.com> on 2008/07/04 12:23:36 UTC

Showing valid characters from a validator mask

Hi all,
I've got a form bean for a user which has a field username (duuhhh:)
We use a mask of  ^[a-zA-Z_0-9-]*$. Is there a way I can show the
valid characters to the user? Currently the error message in
ApplicationResources properties is:

errors.invalid={0} is invalid.

and the xdoclet tags are :

    /**
     * @struts.validator type="required,mask,maxlength"
     *
     * @struts.validator-var name="maxlength" value="20"
     * @struts.validator-var name="mask" value="^[a-zA-Z_0-9-]*$"
     *
     * @struts.validator-args arg0resource="validator.reg.username"
     * @struts.validator-args arg1value="${var:maxlength}"
     * @struts.validator-args arg2value="${var:mask}"
     *
     * @param username The username to set.
     */
    public void setUsername(String username) {
            this.username = username;
    }

What I am fearing is if I write
errors.invalid={0} is invalid. Valid characters are {2}
all invalid validation messages will be like that.

Thanks.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org