0 Replies Latest reply on Oct 22, 2010 5:31 AM by babbarkrishan

    Struts2 annotation - validation for spaces to be allowed in name

      I am using annotations for validations in my struts2 based application. I want to allow the spaces between company name to user. I was trying following expressions but these are not working... Please let me know what symbol should I use in expression for allowing spaces:

      @RegexFieldValidator(fieldName = "company.name", expression = Constants.COMPANY_NAME_EXPRESSION , key = "errors.company.name.format", message = "errors.company.name.format"),

      where i tried following for COMPANY_NAME_EXPRESSION

      String COMPANY_NAME_EXPRESSION = "^([a-zA-Z0-9@_.-\\s]+)$"
      String COMPANY_NAME_EXPRESSION = "^([a-zA-Z0-9@_.-\\\\s]+)$"

      Krishan Babbar