Results 1 to 3 of 3

Thread: @Expression validation and case sensitivity

  1. #1
    Join Date
    Nov 2007
    Location
    Austin, TX USA
    Posts
    154

    Default @Expression validation and case sensitivity

    If I have an @Expression that is excluding a list of words using the IN 'word' operator, that list is case sensitive right? is there a way to make it case insensitive?


    how many times can i use the OR operator? just once?

  2. #2
    Join Date
    Nov 2007
    Location
    Austin, TX USA
    Posts
    154

    Default

    heres what im trying to do. how can i use more than one expression? and is this syntax below right?

    @Expression(value = "userName IS WORD", errorCode = "username.has.spaces")
    @NotBlank
    @Length(min=3, max=20)
    @Expression(value="userName NOT IN 'administrator', 'admin'," +"'support', 'help', 'helpdesk', 'customer support', 'customersupport', 'service', " errorCode = "username.taken")
    private String userName;

  3. #3
    Join Date
    Nov 2007
    Location
    Austin, TX USA
    Posts
    154

    Default

    also in the following code what is the point of the third argument to rejectValue?
    Code:
    try {
    userService.registerUserIfValid(user, !result.hasErrors());  
    } catch (DuplicateRegistrationException dre) {
    if (dre.isUsernameTaken()) {
    result.rejectValue("username", "not.unique",
    new String[] { "Username" }, null);  
    }
    if (dre.isEmailTaken()) {
    result.rejectValue("email", "not.unique");
    }
    }
    if (result.hasErrors

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •