zoukankan      html  css  js  c++  java
  • Caused by: 元素类型为 "package" 的内容必须匹配 "(result-types?,interceptors?,default-interceptor-ref?,default-action-ref?,default-class-ref?,global-results?,global-exception-mappings?,action*)"

    Caused by: 元素类型为 "package" 的内容必须匹配 "(result-types?,interceptors?,default-interceptor-ref?,default-action-ref?,default-class-ref?,global-results?,global-exception-mappings?,action*)"该错误的意思是:package的内容必须按

    result-types

    interceptors

    default-interceptor-ref

    default-action-ref

    default-class-ref

    global-results

    global-exception-mappings

    action*

    这样的顺序放置

    以下是struts.xml中的package的内容:

    ......
    <package name="default" namespace="/" extends="struts-default"> <default-action-ref name="index" />
         <action name="index">
           <result>index.jsp</result>
         </action>
    <global-results> <result name="error">/WEB-INF/pages/public/error.jsp</result> </global-results> <global-exception-mappings> <exception-mapping exception="java.lang.Exception" result="error" /> </global-exception-mappings> </package>
    .....

    解决办法:将action放置到如下位置就好了

        <package name="default" namespace="/" extends="struts-default">
            <default-action-ref name="index" />
            <global-results>
                <result name="error">/WEB-INF/pages/public/error.jsp</result>
            </global-results>
            <global-exception-mappings>
                <exception-mapping exception="java.lang.Exception" result="error" />
            </global-exception-mappings>
            <action name="index">
                <result>index.jsp</result>
            </action>
        </package>
  • 相关阅读:
    HDU5418.Victor and World(状压DP)
    POJ2686 Traveling by Stagecoach(状压DP)
    POJ3254Corn Fields(状压DP)
    HDU5407.CRB and Candies(数论)
    CodeForces 352D. Jeff and Furik
    CodeForces 352C. Jeff and Rounding(贪心)
    LightOj 1282 Leading and Trailing
    Ural 1057. Amount of Degrees(数位DP)
    HDU 2089 不要62 (数位DP)
    HDU5366 The mook jong (DP)
  • 原文地址:https://www.cnblogs.com/liaojie970/p/5200115.html
Copyright © 2011-2022 走看看