由Spring接管Action(MappingDispatchAction)如何配置?

08-11-05 maybe723
web.xml中已做相应配置:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext-*.xml</param-value>
</context-param>

<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
struts-config.xml中的配置文件:
<action-mappings>

<action path="/ma/userLogin" scope="request"
type="test.action.UserAction" parameter="userLogin">
<forward name="failed" path="/index.jsp" />
<forward name="success" path="/default.jsp" redirect="true" />
</action>
</action-mappings>
<controller processorClass="org.springframework.web.struts.DelegatingRequestProcessor">
</controller>
UserAction继承MappingDispatchAction;
那在Spring中的如何配置啊,我这样配置不行?
<bean name="/ma/userLogin"
class="test.action.UserAction">
<property name="userService">
<ref bean="userService" />
</property>
</bean>

maybe723
2008-11-05 13:50
原来是struts-config.xml中把type="test.action.UserAction" 去掉!
疑问:
如果在action中path="/ma/userLogin" 是这样的形式加上type会有问题,但是action是path="/userLogin"就不会报错,是何原因?