Spring与 Struts 整合


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58

1, Spring 在web.xml中配置Spring listener
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/classes/applicationContext.xml</param-value>
</context-param>
2, Strutx 配置
1.x, 在struts-config.xml中为action的type指定为 org.springframework.web.struts.DelegatingActionProxy
2.x? 在struts.xml中为action的class指定为具体类(只注入属性),或bean id
3, Spring在 applicationContext.xml中配置bean id
1.x 全部配置,bean id与action的path相同
2.0? 按action的class做相应配置,
???? 若是属性注入, bean id 要与action类中的属性名相同
???? 若是全部注入, bean id 要与action在配置文件中中指定的class相同