[code="java"]
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<!-- Constants -->
<!-- Configuration for the default package. -->
<package name="default" extends="struts-default">
<interceptors>
<!-- Interceptor to handle allowing only admins to certain actions -->
<interceptor name="adminOnly" class="adminInterceptor" />
<!--Copied from struts-default.xml and changed validation exclude
methods
-->
<interceptor-stack name="defaultStack">
<interceptor-ref name="exception" />
<interceptor-ref name="alias" />
<interceptor-ref name="servletConfig" />
<interceptor-ref name="prepare" />
<interceptor-ref name="i18n" />
<interceptor-ref name="chain" />
<interceptor-ref name="debugging" />
<interceptor-ref name="profiling" />
<interceptor-ref name="scopedModelDriven" />
<interceptor-ref name="modelDriven" />
<interceptor-ref name="fileUpload" />
<interceptor-ref name="checkbox" />
<interceptor-ref name="staticParams" />
<interceptor-ref name="params">
<param name="excludeParams">dojo\..*</param>
</interceptor-ref>
<interceptor-ref name="conversionError" />
<interceptor-ref name="validation">
<param name="excludeMethods">cancel,execute,delete,edit,list</param>
</interceptor-ref>
<interceptor-ref name="workflow">
<param name="excludeMethods">input,back,cancel,browse</param>
</interceptor-ref>
</interceptor-stack>
<interceptor-stack name="fileUploadStack">
<interceptor-ref name="fileUpload" />
<interceptor-ref name="defaultStack" />
</interceptor-stack>
<interceptor-stack name="adminCheck">
<interceptor-ref name="defaultStack" />
<interceptor-ref name="adminOnly" />
</interceptor-stack>
</interceptors>
<global-results>
<result name="mainMenu" type="redirectAction">index</result>
<result name="dataAccessFailure">/WEB-INF/pages/dataAccessFailure.jsp</result>
</global-results>
<global-exception-mappings>
<exception-mapping exception="org.springframework.dao.DataAccessException"
result="dataAccessFailure" />
</global-exception-mappings>
<action name="mainMenu">
<result name="success">/WEB-INF/pages/index.jsp</result>
</action>
<action name="signup" class="signupAction">
<result name="cancel" type="redirect">/</result>
<result name="input">/WEB-INF/pages/signup.jsp</result>
<result name="success" type="chain">saveSignup</result>
</action>
<action name="saveSignup" class="signupAction" method="save">
<result name="input">/WEB-INF/pages/signup.jsp</result>
<result name="success" type="redirectAction">/mainMenu</result>
</action>
<action name="editUser" class="userAction" method="edit">
<interceptor-ref name="adminCheck" />
<result name="success">/WEB-INF/pages/userForm.jsp</result>
<result name="input">/WEB-INF/pages/admin/userList.jsp</result>
</action>
<action name="editProfile" class="userAction" method="edit">
<result name="success">/WEB-INF/pages/userForm.jsp</result>
<result name="error">/WEB-INF/pages/mainMenu.jsp</result>
</action>
<action name="saveUser" class="userAction" method="save">
<result name="cancel" type="redirectAction">admin/users</result>
<result name="input">/WEB-INF/pages/userForm.jsp</result>
<result name="success" type="redirectAction">admin/users</result>
</action>
<action name="queryTargetUsers" class="com.asb.oas.webapp.action.UserAction"
method="queryUser">
<result name="success" type="stream">
<param name="contentCharSet">GBK</param>
</result>
</action>
<!--
action name="uploadFile"
class="com.asb.oas.webapp.action.FileUploadAction"> <interceptor-ref
name="fileUploadStack" /> <result
name="input">/WEB-INF/pages/uploadForm.jsp</result> <result
name="success">/WEB-INF/pages/uploadDisplay.jsp</result> <result
name="cancel" type="redirectAction">mainMenu</result> </action
-->
<action name="passwordHint" class="passwordHintAction">
<result name="input">/</result>
<result name="success">/</result>
</action>
<action name="index" class="signupAction" method="index">
<result>/WEB-INF/pages/index.jsp</result>
</action>
[/code]
这是从别人的项目里贴过来的,我自己的项目的struts完全没这么复杂啊.谁帮我解释一下,或者指条明路。