Announcement Announcement Module
Collapse

Spring Modules forum decommissioned in favor of Spring Extensions

As the Spring Modules project has been replaced by the Spring Extensions (http://www.springsource.org/extensions) project, this forum has been decommissioned in favour of Spring Extensions one at:
http://forum.springsource.org/forumdisplay.php?f=44

Please see the Spring Extensions home page for a complete list of current projects in Java, .NET and ActionScript. You can also propose one if you want.

Cheers,
Costin Leau
SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
http://twitter.com/costinl
See more
See less
@Expression validation and case sensitivity Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • @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
    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;

    Comment


    • #3
      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

      Comment

      Working...
      X