jsf - How to integrate Hibernate Validator into Tomcat 7? -


i've integrated jsf (mojarra) , cdi (weld), can't hibernate validator work.

the following jars added web-inf/lib:

validation-api-1.1.0.final.jar hibernate-validator-5.1.0.final.jar jboss-logging-3.1.3.ga.jar classmate-1.0.0.jar 

tomcat 7 comes el 2.2 jars didn't add them.

my jsf page:

<!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"       xmlns:h="http://xmlns.jcp.org/jsf/html"       xmlns:f="http://xmlns.jcp.org/jsf/core">     <h:head>         <title>test</title>     </h:head>     <h:body>         <h:form>             <h1><h:outputtext id="hello" value="hello, #{testcontroller.name}!"/></h1>             <p:inputtext id="name" value="#{testcontroller.name}"/>             <h:message id="error" for="name"/>             <h:commandbutton value="change name">                 <f:ajax execute="name" render="hello error"/>             </h:commandbutton>         </h:form>     </h:body> </html> 

and backing bean:

@named @applicationscoped public class testcontroller {     @notnull     @size(min = 3, max = 5)     private string name;      @postconstruct     private void init() {         name = "bill";     }      public string getname() {         return name;     }      public void setname(string name) {         this.name = name;     } } 

it's expected when size of name smaller 3 or bigger 5, error message shown, turns out not. seems hibernate validator not working . did see it's detected no longer logged:

mar 11, 2014 9:31:40 pm org.hibernate.validator.internal.util.version <clinit> info: hv000001: hibernate validator 5.1.0.final 

is there wrong?

update

finally figured out it's mojarra regression. hibernate validator works myfaces.

just avoid confusion (as have been confused, looking error despite had been solved because didn't see update section @ end of post), let me add answer on behalf of op:

it seems op used mojarra version broken. solved problem migrating myfaces (see update question). fwiw, tried example using mojarra 2.2.12, , worked fine.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -