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 <[email protected]> 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: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to