title: Hibernate validator. Number field
body: <p>I want to validate a jsp field. There should be a positive number (1, 100, 1000, etc). But I get an error when I put there a String value:</p>
  
  <pre><code>No validator could be found for type: java.lang.Long.
  </code></pre>
  
  <p>Here is a code from the model:</p>
  
  <pre><code>@NotNull @Pattern(regexp = "[0-9]+", message = "wrong Sort number")
  private Long depOrder;
  </code></pre>
  
  <p>How could I get my "wrong Order number" message instead of that ugly error.
  Thanks.</p>