如题
版本:javaee 6.0 struts1.2 spring3.0
在 <message-resources> 标签后面添加了:
<plug-in className=”org.springframework.web.struts.ContextLoaderPlugIn”>
<set-property property=”contextConfigLocation” value=”/WEB-INF/applicationContext.xml” />
</plug-in>
修改 LoginAction 的配置( type 属性):
<action-mappings >
<action
attribute=”loginForm”
input=”/login.jsp”
name=”loginForm”
path=”/login”
scope=”request”
type=”org.springframework.web.struts.DelegatingActionProxy” />
</action-mappings>
修改 Spring 配置文件 applicationContext.xml
<?xml version=”1.0″ encoding=”UTF-8″?>
<!DOCTYPE beans PUBLIC “-//SPRING//DTD BEAN//EN” “http://www.springframework.org/dtd/spring-beans.dtd”>
<beans>
<bean name=”/login” class=”com.yourcompany.struts.action.LoginAction” scope="prototype"></bean>
</beans>