Hi, 

I want to try a very basic  validation on an input text field which name is 
"value"

This is my stateful bean


  | ....
  | 
  |     public void sayHello()
  |     {
  |                 facesMessages.add("hello #{hello.value}");
  |     }
  |     
  |      
  |     
  |     @Length(max=10)
  |     public String getValue()
  |     {
  |         return value;
  |     }
  | 
  | ......
  | 

And the jsf part

  | <h:inputText id="value" required="true"
  |                          value="#{hello.value}">                            
 
  |                          <s:validate/>
  | </h:inputText>
  |                 
  | <h:message for="value"/>
  | 

If I don't fill the input, I have a "value is required" message,  which is 
expected as I set required="true".

But if the value is more than 10 characters long, I have no errors, however I 
put the annotation @Length(max=10).

So what did I miss ?



View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4061648#4061648

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4061648
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to