スプリングは注入できません
49210 ワード
struts 2統合spring 3起動エラーなくSpring初期化に成功しました.情報:Initializing Spring root WebAppliation Contect
しかし、actionではspringでは注入できないdaoやserviceは使えません.
解決策:
1、struts 2-spring-plugin.jarパッケージに入っていません.
2、設定ファイルが本当に大丈夫かどうかを確認する
3、struts.xmlでaction配置のclassパスをaplication.xml配置の対応actionのid属性に修正します.
変更前:
[html
view plin
copy
<struts><packagename=「budget」extens=「struts-default」<actioname=“login”class=“loginnAction”method=“verifyUser”<reultname=「success」financeセンター/センター.jsp<resultname=「error」login/error.jsp<struts>springプロファイルは不変です.
しかし、actionではspringでは注入できないdaoやserviceは使えません.
解決策:
1、struts 2-spring-plugin.jarパッケージに入っていません.
2、設定ファイルが本当に大丈夫かどうかを確認する
3、struts.xmlでaction配置のclassパスをaplication.xml配置の対応actionのid属性に修正します.
変更前:
変更後:[html
view plin
copy
<struts><packagename=「budget」extens=「struts-default」<actioname=“login”class=“loginnAction”method=“verifyUser”<reultname=「success」financeセンター/センター.jsp<resultname=「error」login/error.jsp<struts>springプロファイルは不変です.
第三の原因はお父さんによくないです.二時間も苦労しました......