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的内容:

  1. ......
    <package name="default" namespace="/" extends="struts-default">
  2. <default-action-ref name="index" />
         <action name="index">
           <result>index.jsp</result>
         </action>
  3. <global-results>
  4. <result name="error">/WEB-INF/pages/public/error.jsp</result>
  5. </global-results>
  6. <global-exception-mappings>
  7. <exception-mapping exception="java.lang.Exception" result="error" />
  8. </global-exception-mappings>
  9. </package>
    .....

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

  1. <package name="default" namespace="/" extends="struts-default">
  2. <default-action-ref name="index" />
  3. <global-results>
  4. <result name="error">/WEB-INF/pages/public/error.jsp</result>
  5. </global-results>
  6. <global-exception-mappings>
  7. <exception-mapping exception="java.lang.Exception" result="error" />
  8. </global-exception-mappings>
  9. <action name="index">
  10. <result>index.jsp</result>
  11. </action>
  12. </package>

Caused by: 元素类型为 "package" 的内容必须匹配 "(result-types?,interceptors?,default-interceptor-ref?,default-action-ref?,default-class-ref?,global-results?,global-exception-mappings?,action*)"的更多相关文章

  1. Struts配置文件报错"元素类型为 "package" 的内容必须匹配"

    报错信息 元素类型为 "package" 的内容必须匹配 "(result-types?,interceptors?,default-interceptor-ref?,d ...

  2. 元素类型为 "package" 的内容必须匹配 "(result-types?,interceptors?,default-interceptor-ref?

    该错误为struts.xml内配置文件节点顺序错误. package内的元素节点必须按照以下顺序排放:  result-types         interceptors         defau ...

  3. 解决 Mybatis 元素类型为 "resultMap" 的内容必须匹配 "(constructor?,id*,result*,association*,collection*,discriminat

    在配置 mybatis mapper.xml文件时, 一不小心就会报如下类似的异常: Caused by: org.springframework.beans.factory.BeanCreation ...

  4. org.xml.sax.SAXParseException; lineNumber: 14; columnNumber: 32; 元素类型为 "key" 的内容必须匹配 "(column)*"

    报错:部分错误信息,主要查看CauseBy Caused by: org.hibernate.InvalidMappingException: Unable to read XML at org.hi ...

  5. MyBatis 元素类型为 "configuration" 的内容必须匹配 ".....

    修改MyBatis配置文件时,添加typeAliases节点,报了一个BuilderException: org.apache.ibatis.exceptions.PersistenceExcepti ...

  6. 元素类型为 "configuration" 的内容必须匹配 "(properties?,settings?,typeAliases?,typeHandlers?

    报错主要部分如下: Error building SqlSession.### Cause: org.apache.ibatis.builder.BuilderException: Error cre ...

  7. mybatis下报错:元素类型为 "mapper" 的内容必须匹配 "(cache-ref|cache|resultMap*|parameterMap

    今天使用别人的代码报错,但是有时又不报错原来是配置文件的顺序要遵守 注意 "必须匹配" 四个字, 其意味着顺序很重要, 必须要一致, 试试将 resultMap 中各元素的顺序修改 ...

  8. 错误Mybatis 元素类型为 "resultMap" 的内容必须匹配 "(constructor?,id*,result*,association*,collection*,discriminat

    今天算是见识了什么事顺序的重要性. 在使用mybatis时由于联合了其他的表,用到了resultMap,之后外加association这一项.可是在替换对应字段的位置上加上association总是报 ...

  9. 元素类型为 "session-factory" 的内容必须匹配 "(property*,mapping*,(class-cach....解决方法

    http://www.cnblogs.com/kisso143/p/3642057.html property必须写在mapping的上面.

随机推荐

  1. Sqli-labs less 49

    Less-49 本关与47关基本类似,区别在于没有错误回显,所以我们可以通过延时注入和导入文件进行注入. 利用延时注入 http://127.0.0.1/sqli-labs/Less-49/?sort ...

  2. MM1排队系统

    #coding=utf-8 import time import random as rd #import math import pylab as pl def simulate(nameda,u) ...

  3. 使用Zend OpCache 提高 PHP 5.5+ 性能

    使用Zend OpCache 提高 PHP 5.5+ 性能 作者:admin | 时间:February 28, 2015 | 分类:Linux | 评论:1 评论 PHP 5.5 以后内建了 OpC ...

  4. MEAN实践——LAMP的新时代替代方案(下)

    在本系列文章的第一部分旨在介绍一些应用程序的基础技术细节和如何进行数据建模,而这个部分文章将着手建立验证应用程序行为的测试,并会指出如何启动和运行应用程序. 首先,编写测试 首先定义一些小型配置库.文 ...

  5. winform中的时间轴控件

    我现在做的项目遇到一个需求,就是有没有类似的控件: 我要实现的功能是:播放录像. 某个时间段内假如有2个录像,这个坐标表示的是时间,假如我现在拖动时间轴,拖到第一个录像里面开始播放第一个录像,拖到2个 ...

  6. 3[doses] ------一种诡异的写法

    在 head first c 的第60页,有这么一道题: 一个富翁因为服药过度而死亡. 下面是自动服药器的代码: #include <stdio.h> int main(void) { , ...

  7. HDU 4493 Tutor(精度处理)

    题目 #include<stdio.h> int main() { int t; double a,s; scanf("%d",&t); while(t--) ...

  8. POJ 1650

    #include <iostream> #include <cmath> //wo de 编译器里的这个abs的功能不能用啊! using namespace std; int ...

  9. POJ 1185 炮兵阵地 (状压DP)

    题目链接 题意 : 中文题不详述. 思路 :状压DP,1表示该位置放炮弹,0表示不放.dp[i][j][k],代表第 i 行的状态为k时第i-1行的状态为 j 时放置的最大炮弹数.只是注意判断的时候不 ...

  10. hdu 4618(最大回文子矩阵)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4618 昨天多校的一道题,说多了都是泪啊,为了一道图论题,磨了那么久,结果是别的题都没看,没办法,补呗. ...