完整的struts.xml示范
文件示范。
??????? "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
??????? "http://struts.apache.org/dtds/struts-2.0.dtd">
<???????????????????????????????? ???????????????????????????????? <constant name="" value="" />
???????????????????????????????? ???????????????????????????????? <bean type="" name="" scope="" static="" optional="" />
???????????????????????????????? ???????????????????????????????? <include file="" />
???????????????????????????????? ???????????????????????????????? <package name="必填的包名" extends="" namespace="" abstract=""
??????????????????????????????????? ??????????????????????????????????? ??????????????????????????????????? <??????????????????????????????????????? ??????????????????????????????????????? <result-type name="" default="true|false">
??????????????????????????????????????????? ??????????????????????????????????????????? <param name="参数名">参数值</param>*
??????????????????????????????????????? </result-type>
??????????????????????????????????? </result-types>
??????????????????????????????????? ??????????????????????????????????? <??????????????????????????????????????? ??????????????????????????????????????? 也可以二者都出现 -->
??????????????????????????????????????? ??????????????????????????????????????? <interceptor name="" style="background: #f9fcfe; line-height: 160%; text-align: left;">??????????????????????????????????????????? ??????????????????????????????????????????? <param name="参数名">参数值</param>*
??????????????????????????????????????? </interceptor>
??????????????????????????????????????? ??????????????????????????????????????? <interceptor-stack name="">
??????????????????????????????????????????? ??????????????????????????????????????????? <interceptor-ref name="">
??????????????????????????????????????????????? ??????????????????????????????????????????????? <param name="参数名">参数值</param>*
??????????????????????????????????????????? </interceptor-ref>
??????????????????????????????????????? </interceptor-stack>
??????????????????????????????????? </interceptors>
??????????????????????????????????? ??????????????????????????????????? <default-interceptor-ref name="">
??????????????????????????????????????? ??????????????????????????????????????? <param name="参数名">参数值</param>
??????????????????????????????????? </default-interceptor-ref>
??????????????????????????????????? ??????????????????????????????????? <default-action-ref name="">
??????????????????????????????????????? ??????????????????????????????????????? <param name="参数名">参数值</param>*
??????????????????????????????????? ??????????????????????????????????? ??????????????????????????????????? <??????????????????????????????????????? ??????????????????????????????????????? <result name="" type="">
??????????????????????????????????????????? ??????????????????????????????????????????? 映射资源
??????????????????????????????????????????? ??????????????????????????????????????????? <param name="参数名">参数值</param>*
??????????????????????????????????????? </result>
??????????????????????????????????? </global-results>
??????????????????????????????????? ??????????????????????????????????? <??????????????????????????????????????? ??????????????????????????????????????? <exception-mapping name="" exception="" result="">
??????????????????????????????????????????? 异常处理资源
??????????????????????????????????????????? ??????????????????????????????????????????? <param name="参数名">参数值</param>*
??????????????????????????????????????? </exception-mapping>
??????????????????????????????????? </global-exception-mappings>
??????????????????????????????????? <action name="" method="" converter="">
??????????????????????????????????????? ??????????????????????????????????????? <param name="参数名">参数值</param>*
??????????????????????????????????????? ??????????????????????????????????????? <result name="" type="">
??????????????????????????????????????????? 映射资源
??????????????????????????????????????????? ??????????????????????????????????????????? <param name="参数名">参数值</param>*
??????????????????????????????????????? </result>
??????????????????????????????????????? ??????????????????????????????????????? <interceptor-ref name="">
??????????????????????????????????????????? ??????????????????????????????????????????? <param name="参数名">参数值</param>*
??????????????????????????????????????? </interceptor-ref>
??????????????????????????????????????? ??????????????????????????????????????? <exception-mapping name="" exception="" result="">
??????????????????????????????????????????? 异常处理资源
??????????????????????????????????????????? ??????????????????????????????????????????? <param name="参数名">参数值</param>*
??????????????????????????????????????? </exception-mapping>
??????????????????????????????????? </action>
???????????????????????????????? </package>*
<struts>