strut2 的配置文件

来源:互联网 发布:淘宝官方话费充值平台 编辑:程序博客网 时间:2024/05/29 03:47

------ 总配置文件

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN"
    "http://struts.apache.org/dtds/struts-2.1.dtd">
 <struts>
 <include file="com/chinasofit/xml/struts2.xml"></include>
 
</struts>

 

-------子配置文件

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN"
    "http://struts.apache.org/dtds/struts-2.1.dtd">

<struts>
   
 <constant name="struts.i18n.encoding" value="utf-8" />
 <package name="default" extends="struts-default" namespace="/">
 
 <global-results>
  <result name="error">
  /error.jsp
  </result>
 </global-results>
 <global-exception-mappings>
  <exception-mapping result="error" exception="MyException" name="error"></exception-mapping>
 </global-exception-mappings>
 
 <action name="login" class="com.chinasofit.action.LoginAction" method="turn">
  <interceptor-ref name="fileUploadStack">
  </interceptor-ref>
  <result name="success">/MyJsp.jsp</result>
 </action>

 </package>
</struts>