struts2单独使用时act
假如:LoginAction在包cn.edu.jlu.cs.act
1. struts2单独使用时,act
...
<act
<result name="studentSuccess">
/student/studentindex.jsp
</result>
...
2. struts2与spring集成时,class属性是spring的applicationContext.xml中配置的bean的id属性值。
---------------------------------------------------------------------------------------
//struts.xml
...
<act
<result name="studentSuccess">
/student/studentindex.jsp
</result>
...
----------------------------------------------------------------------------------------
//applicationContext.xml
...
<bean id="LoginAction" class="cn.edu.jlu.cs.act
...
----------------------------------------------------------------------------------------
本文介绍了Struts2框架在独立使用与集成Spring框架时,struts.xml配置文件中的action配置差异。具体而言,当Struts2独立使用时,action的class属性需要指定全路径名;而在与Spring集成的情况下,则只需引用Spring中定义的bean ID。

6816

被折叠的 条评论
为什么被折叠?



