我使用的春天的Webflow,這是我的流程春Webflow的「屬性未找到」例外
<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"/>
我已啓用了自動掃描我的servlet上下文:
<context:component-scan base-package="com.me.myproj" />
我得到一個org.springframework.binding.expression.PropertyNotFoundException:未找到屬性錯誤爲狀態checkEmail。問題是,它不承認我的「阿爾塔」豆,這是我的阿爾塔類(放在com.me.myproj):
@Component
public class Alta {
public Alta(){
System.out.println("constructor ok");
}
public boolean checkEmail(String email){
return "[email protected]".equals(email);
}
}
如果我明確創建bean:
<bean id="alta" class="com.me.myproj.Alta"/>
然後它工作正常。所以看起來流程上下文不能識別自動掃描的組件,雖然alta是instanciated(就像我在調試時看到的那樣)。
我該怎麼做才能避免顯式聲明所有涉及到我的流程的bean?
它解決了嗎?什麼是修復? –
不,對不起,我沒有工作了.. – de3