struts2和spring整合比较深入的分析(在struts.xml中指定ClassName与指定BeanID的区别)
struts.xml
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"><struts> <include file="struts-default.xml"/> <package name="default" extends="struts-default"> <action name="foo" class="com.acme.Foo"> <result>foo.ftl</result> </action> </package> <package name="secure" namespace="/secure" extends="default"> <action name="bar" class="bar"> <result>bar.ftl</result> </action> </package></struts>
Where you have a Spring bean defined in your applicationContext.xml named "bar". Note that the com.acme.Foo Action did not need to be changed, because it can be autowired.
?
如何理解这句话,本文附件告诉你答案:? 关于Struts2与Spring整合的一些疑惑及解释。? 文中主要谈在struts.xml中配置Action的时候,在class属性上指定className与指定BeanID的区别。
1 楼 SoloTerran 2010-02-27 lz的文章最后不还是建议把action交给spring么?