title: Spring 3 validation (JSR-303) @Min
body: <p>I am trying to validate an input field that is supposed to contain (if not empty) a natural number (i.e. a positive non-zero integer: 1, 2, 3, ....)</p>
  
  <p>I am using the following annotations:</p>
  
  <pre><code>@Digits(integer=10, fraction=0)
  @Min(value = 1)
  private Long number;
  </code></pre>
  
  <p>(Is this the best way to describe my constraint???)</p>
  
  <p>When I submit a number such as 1.5 I get a <strong>VALIDATION MESSAGE</strong> which is good.
  However when I submit an input such as -1 I do not get any VALIDATION MESSAGE. What do I miss?</p>
  
  <p>Thanks!</p>
  
  <p>P.S. Since my (other) Hibernate annotations for this field were on the getter of the field, I just move these two annotations to the getter as well (instead of being on the actual field). Did not help.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I just read I might need to add <code>&lt;mvc:annotation-driven /&gt;</code> to my XML. I did it, however while starting the server I am getting the exception:</p>
  
  <p><code>org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/mvc]
  Offending resource: ServletContext resource [/WEB-INF/dispatcher-servlet.xml]</code></p>
  
  <p>I am not sure what it means and if I actually need (????) that annotation-driven tag... also, if I needed that annotation-driven tag in my xml, why did my other annotations (including one of the validation annotations) work without it?</p>