<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.devMode" value="true" />
<constant name="struts.objectFactory" value="spring" />
<package name="common" extends="struts-default">
<global-results>
<result name="error">/common/miplatform_error.jsp</result>
</global-results>
<global-exception-mappings>
<exception-mapping exception="java.lang.Exception" result="error"/>
</global-exception-mappings>
</package>这些代码是什么作用?
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.devMode" value="true" />
<constant name="struts.objectFactory" value="spring" />
<package name="common" extends="struts-default">
<global-results>
<result name="error">/common/miplatform_error.jsp</result>
</global-results>
<global-exception-mappings>
<exception-mapping exception="java.lang.Exception" result="error"/>
</global-exception-mappings>
</package>这些代码是什么作用?
Whether Struts is in development mode or not
是否为struts开发模式struts.objectFactory
The com.opensymphony.xwork2.ObjectFactory implementation class
com.opensymphony.xwork2.ObjectFactory接口(spring)
事务用spring
<package name="common" extends="struts-default">
<global-results>
<result name="error">/common/miplatform_error.jsp</result>
</global-results>
<global-exception-mappings>
<exception-mapping exception="java.lang.Exception" result="error"/>
</global-exception-mappings>
</package>
配置当程序报java.lang.Exception错误的时候跳转到
common/miplatform_error.jsp
>_<
http://www.wangmeng.cn/Article/SOFTDEVELOP/JAVA/200705/2722.html
<global-results>
<result name="error">/common/miplatform_error.jsp </result>
</global-results>
<global-exception-mappings>
<exception-mapping exception="java.lang.Exception" result="error"/>
</global-exception-mappings>
</package>
包名为common 默认缺省设置 当发生异常java.lang.Exception时 异常页面跳转到common/miplatform_error.jsp