1.清楚他们之间的关系
**struts.xml**
global.xml
其他子文件
sw.xml
xq.xml
继承关系
子文件——>global.xml——>struts.xml
低一级文件必须继承上一层的文件的名字
如:
子文件需要继承global.xml; extends=“global”
global.xml继承struts.xml; extends=“struts.devMode”
注意事项
1.在struts中必须打开开发者模式 设置为 value=“true”;
<constant name="struts.devMode" value="true"></constant>
2.在struts中配置全局的信息
//全局错误跳转页面**
<global-results>
<result name="error">error.jsp</result>
</global-results>
//全局的错误收集
<global-exception-mappings>
<exception-mapping result="error" exception="java.lang.Exception"></exception-mapping>
</global-exception-mappings>
3.将其他的配置文件引入进来
//<include file="sw.xml"></include>
// <include file="xq.xml"></include>