Spring管理Struts Action
參考文檔:
使用 Spring 更好地處理 Struts 動作
可以通過三種方式實現Spring管理Struts Action:
- 使用 Spring 的 ActionSupport 類整合 Structs
- 使用 Spring 的 DelegatingRequestProcessor 覆蓋 Struts 的 RequestProcessor
- 將 Struts Action 管理委托給 Spring 框架
本文將討論第三種方式:
步驟一:在Struts-config.xml中加入Spring插件ContextLoaderPlugin,為 Struts 的 ActionServlet 裝載 Spring 應用程序環境。





其中strutsbean.xml為定義Struts Action的配置文檔。
步驟二:在Struts-config.xml中將Action替換為代理類DelegatingActionProxy,負責在 Spring 環境中查找 Struts 動作。






其中DelegatingActionProxy會根據path="/searchSubmit",到前面定義的strutsbean.xml文件中找尋相應的Action.
步驟三:定義Struts Action映射文件strutsbean.xml。












posted on 2007-01-08 16:57 zJun's帛羅閣 閱讀(1837) 評論(0) 編輯 收藏 所屬分類: 開源軟件