1.1. Web.xml
服务启动文件
1.2. struts.xml
主配置文件
1.3. struts.properties
属性文件,可以进行转码等操作,当然也可以在web.xml和 struts.xml中进行配置,如果同时在多个文件中配置的话,存在优先级
1.4. struts-default.xml
struts2的默认配置文件,jar包自带的,为可读文件
1.5. struts-plugin.xml
struts2的插件配置文件
Struts.properties在struts2-core.jar包下的org.apache.struts2下的default.properties中设置,改变默认*.action访问方式为*.do,在default.properties【解读文档内容后进而自身设置】中修改struts.action.extension = action
但是由于以上文件为只读文件不能修改,所以要想达到目的还得自己编写文件struts.properties,同struts.xml放在同一目录下。
当然,这种方式改变访问方式就复杂了,完美可以在struts.xml中进行常量的设置,
在<struts></struts>中添加<constant name="struts.action.extension" value="do,action"></constant>,这样的话*.do与*.action均可达到访问
<!--EndFragment-->