首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > XML SOAP >

struts-config.xml配备实现spring的依赖注入

2012-11-07 
struts-config.xml配置实现spring的依赖注入struts-config.xml中配置action的时候,将type属性改为org.spr

struts-config.xml配置实现spring的依赖注入

struts-config.xml中配置action的时候,将type属性改为"org.springframework.web.struts.DelegatingActionProxy",在spring的配置文件配置依赖注入才可以成功。

如下的代码:

?<action-mappings>
????<action attribute="registerForm" input="/form/register.jsp"
???name="registerForm" path="/register" scope="request"
???type="org.springframework.web.struts.DelegatingActionProxy">
???<forward name="failed" path="/form/failed.jsp" />
???<forward name="success" path="/form/success.jsp" />
??</action>
?</action-mappings>

热点排行