steps1-->Struct2-配置文件

   当struts2创建系统的Action代理时,需要使用struts2配置文件。

 Struts 2的配置文件有两份:

— 配置Action的struts.xml文件。

— 配置Struts 2全局属性的struts.properties文件。

   struts.xml文件内定义了Struts 2的系列Action,定义Action时,指定该Action的实现类,并定义该Action处理结果与视图资源之间的映射关系

 <package name="affiche" namespace="/affiche" extends="power-default">
<action name="*" class="com.power.web.action.affiche.AfficheAction" method="{1}">
</action>
</package>
<package name="meetingNotice" namespace="/meetingNotice" extends="power-default">
<action name="*" class="com.power.web.action.meetingNotice.NoticeAction" method="{1}">
</action>
</package>

除此之外,Struts 2还有一个配置Struts 2全局属性的Properties文件:struts.properties。该文件的示例如下:

#指定Struts 2处于开发状态

struts.devMode = false

//指定当Struts 2配置文件改变后,Web框架是否重新加载Struts 2配置文件

struts.configuration.xml.reload=true

 



posted on 2012-01-06 09:14  it_code  阅读(1506)  评论(0编辑  收藏  举报