I am using spring webflow, this is my flow
<view-state id="welcome">
<transition on="emailEntered" to="checkEmail"></transition>
</view-state>
<decision-state id="checkEmail">
<if test="alta.checkEmail(requestParameters.email)"
then="okState"
else="errorState"/>
</decision-state>
<view-state id="okState"/>
<view-state id="errorState"/>
I have enabled auto-scanning in my servlet-context:
<context:component-scan base-package="com.me.myproj" />
I get a org.springframework.binding.expression.PropertyNotFoundException: Property not found error for state checkEmail. The problem is that it doesn't recognize my 'alta' bean, this is my Alta class (placed in com.me.myproj):
@Component
public class Alta {
public Alta(){
System.out.println("constructor ok");
}
public boolean checkEmail(String email){
return "[email protected]".equals(email);
}
}
If I explicitly create the bean:
<bean id="alta" class="com.me.myproj.Alta"/>
Then it works fine. So it seems that flow context doesn't recognize auto-scanned components, although alta is instanciated (as I saw when I debugged).
What can I do to avoid declaring explictly all beans involved in my flow?