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
validations for optional fields using BVF Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • validations for optional fields using BVF

    Hello,

    With Bean Validation Framework 0.9, how can we validate fields which are not mandatory? For example in a form, middle name is optional but when entered, it should not contain any special characters. Similary email. The email field in a form can be option but when a value is entered it must match the rule "email"

    Code:
    <property name="email">
           <email />
    </property>
    With above code in the validation.xml, an error message is being shown to enter the email address even though it is optional. I tried to use the length and apply-if conditions in addition, but it did not work.

    Could you help me out in this regard please?

    thanks in advance,
    sameer
Working...
X