Use Spring's LocalValidatorFactoryBean
I am hoping to use Spring's LocalValidatorFactoryBean and define it in a Spring context file as follows: ?xml version=1.0 encoding=UTF-8? beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:tx=http://www.springframework.org/schema/tx; xmlns:util=http://www.springframework.org/schema/util; xmlns:mvc=http://www.springframework.org/schema/mvc; xmlns:context=http://www.springframework.org/schema/context; xsi:schemaLocation=http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd; bean id=validator class=org.springframework.validation.beanvalidation.LocalValidatorFactoryBean / /beans However, Spring-configured validator in code is always null: @SpringBean protected Validator validator; In the same Spring context file, I defined other DAO beans used by wicket components and they are just fine. Did anyone have success in configuring and using LocalValidatorFactoryBean? What did I do is wrong? I am using Spring 3.0.2, Hibernate Validator 4.0.2, and Wicket 1.4.7. Thanks for any input! Best. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Use Spring's LocalValidatorFactoryBean
Just a quick check, in case you are using @SpringBean outside of a Wicket component, you have to inject it manually using: InjectorHolder.getInjector().inject(this); On Fri, Apr 9, 2010 at 5:32 PM, David Chang david_q_zh...@yahoo.com wrote: I am hoping to use Spring's LocalValidatorFactoryBean and define it in a Spring context file as follows: ?xml version=1.0 encoding=UTF-8? beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:tx=http://www.springframework.org/schema/tx; xmlns:util=http://www.springframework.org/schema/util; xmlns:mvc=http://www.springframework.org/schema/mvc; xmlns:context=http://www.springframework.org/schema/context; xsi:schemaLocation=http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd; bean id=validator class=org.springframework.validation.beanvalidation.LocalValidatorFactoryBean / /beans However, Spring-configured validator in code is always null: @SpringBean protected Validator validator; In the same Spring context file, I defined other DAO beans used by wicket components and they are just fine. Did anyone have success in configuring and using LocalValidatorFactoryBean? What did I do is wrong? I am using Spring 3.0.2, Hibernate Validator 4.0.2, and Wicket 1.4.7. Thanks for any input! Best. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Use Spring's LocalValidatorFactoryBean
Carlos, thanks for the info. I remember I saw it somewhere but totally forgot this. It worked. Thanks! -David --- On Fri, 4/9/10, Carlos Vara bashfl...@gmail.com wrote: From: Carlos Vara bashfl...@gmail.com Subject: Re: Use Spring's LocalValidatorFactoryBean To: users@wicket.apache.org Date: Friday, April 9, 2010, 12:54 PM Just a quick check, in case you are using @SpringBean outside of a Wicket component, you have to inject it manually using: InjectorHolder.getInjector().inject(this); On Fri, Apr 9, 2010 at 5:32 PM, David Chang david_q_zh...@yahoo.com wrote: I am hoping to use Spring's LocalValidatorFactoryBean and define it in a Spring context file as follows: ?xml version=1.0 encoding=UTF-8? beansĀ xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:tx=http://www.springframework.org/schema/tx; xmlns:util=http://www.springframework.org/schema/util; xmlns:mvc=http://www.springframework.org/schema/mvc; xmlns:context=http://www.springframework.org/schema/context; xsi:schemaLocation=http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd; bean id=validator class=org.springframework.validation.beanvalidation.LocalValidatorFactoryBean / /beans However, Spring-configured validator in code is always null: @SpringBean protected Validator validator; In the same Spring context file, I defined other DAO beans used by wicket components and they are just fine. Did anyone have success in configuring and using LocalValidatorFactoryBean? What did I do is wrong? I am using Spring 3.0.2, Hibernate Validator 4.0.2, and Wicket 1.4.7. Thanks for any input! Best. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org