<package name="lee" extends="struts-default"> <!--定义全局结构映射 --> <global-result> <result name="sql">/sql.jsp</result> <result name="root">/root.jsp</result> </global-result> <!--定义全局异常映射--> <global-exception-mappings> <exception-mapping exception="java.lang.SQLException" result="sql" /> <exception-mapping exception="java.lang.Exception" result="root" /> </global-exception-mappings> <action name="index" class="org.test.IndexAction"> <!--定义局部异常映射,当Action中遇到MyException异常是,系统将转入name为my的结果中--> <exception-mapping exception="org.text.MyException" result="my" /> <result name="my">/index.jsp</result> <result name="success">/success.jsp</result> </action> </package>