zengjd 2014-03-17 12:59 采纳率: 55.6%
浏览 238
已采纳

谁能帮我解释一下下面这个struts配置文件么?完全看不懂啊。

[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完全没这么复杂啊.谁帮我解释一下,或者指条明路。

  • 写回答

3条回答 默认 最新

  • M44346460 2014-03-17 20:35
    关注

    这也算复杂。。。。配置文件都没看懂,你不去看看官方对每个标签的使用说明?

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 java大作业爬取网页
  • ¥15 怎么获取欧易的btc永续合约和交割合约的5m级的历史数据用来回测套利策略?
  • ¥15 有没有办法利用libusb读取usb设备数据
  • ¥15 为什么openeluer里面按不了python3呢?
  • ¥15 关于#matlab#的问题:训练序列与输入层维度不一样
  • ¥15 关于Ubuntu20.04.3LTS遇到的问题:在安装完CUDA驱动后,电脑会进入卡死的情况,但可以通过键盘按键进入安全重启,但重启完又会进入该情况!
  • ¥15 关于#嵌入式硬件#的问题:树莓派第一天重装配置python和opencv后第二天打开就成这样,瞎捣鼓搞出来文件夹还是没把原来的界面调回来
  • ¥20 Arduino 循迹小车程序电路出错故障求解
  • ¥20 Arduino 循迹小车程序电路出错故障求解
  • ¥15 C++数组中找第二小的数字程序纠错