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>