The content of element type "package" must match "(result-types?interceptors?d
来源:互联网 发布:sql双引号转义字符 编辑:程序博客网 时间:2024/06/05 15:47
The content of element type "package" must match "(result-types ,interceptors ,d
各位,谁看出来这哪里错了吗??反正最开始我是没看出来。一运行程
序来个错误。
“The content of element type "package" must match "(result-types ,interceptors ,default-interceptor-ref ,default-action-ref ,default-class-ref ,global-results ,global-exception-mappings ,action*)". ”
刚看到这个错误我就想,哪个也没写错呀。仔细对了好几遍也没发现哪个属
性写错了。最后Google了一下,看了别人写的文章豁然开朗了。
这个错误的意思是,package里元素必须按照一定的顺序排列。这个顺序
就是
result-types
interceptors
default-interceptor-ref
default-action-ref
default-class-ref
global-results
global-exception-mappings
在编写后台登陆模块时,将许多默认的设置放在一个名为default的package
里。然后再定义其他package继承该包。之前我的struts.xml配置如下
<struts> <constant name="struts.objectFactory" value="org.apache.struts2.spring.StrutsSpringObjectFactory" /> <constant name="struts.devMode" value="true" /> <package name="exam_default" extends="struts-default" namespace="/"> <!--自定义拦截器及拦截器栈--> <interceptors> <!--用户认证拦截器--> <interceptor name="authentication" class="action.admin.AuthenticationInterceptor"/> <!--用户认证拦截器栈,用于防止用户非法访问--> <interceptor-stack name="user" > <interceptor-ref name="authentication" /> <interceptor-ref name="defaultStack"/> </interceptor-stack> <interceptor-stack name="guest" > <interceptor-ref name="defaultStack"/> </interceptor-stack> </interceptors> <!--全局异常映射--> <global-exception-mappings> <exception-mapping result="error" exception="java.lang.Exception"/> </global-exception-mappings> <!--全局result--> <global-results> <result name="error">/error.jsp</result> </global-results> </package> <package name="admin" extends="exam_default" namespace="/admin"> <action name="login" class="login"> <result type="redirectAction">index</result> </action> <action name="index"> <result>index.jsp</result> </action> </package></struts>
各位,谁看出来这哪里错了吗??反正最开始我是没看出来。一运行程
序来个错误。
“The content of element type "package" must match "(result-types ,interceptors ,default-interceptor-ref ,default-action-ref ,default-class-ref ,global-results ,global-exception-mappings ,action*)". ”
刚看到这个错误我就想,哪个也没写错呀。仔细对了好几遍也没发现哪个属
性写错了。最后Google了一下,看了别人写的文章豁然开朗了。
这个错误的意思是,package里元素必须按照一定的顺序排列。这个顺序
就是
result-types
interceptors
default-interceptor-ref
default-action-ref
default-class-ref
global-results
global-exception-mappings
action*(就是所有的action放到最后)
原文地址:http://www.educity.cn/wenda/363589.html
0 0
- The content of element type "package" must match "(result-types?interceptors?d
- 如果出现The content of element type "package" must match "(result-types?,interceptors?,default-interce
- “The content of element type "package" must match "(result-types?,interceptors?,default-interceptor-
- The content of element type "package" must match "(result-types?,interceptors?,default-intercept
- struts2---The content of element type "package" must match "(result-types?,interceptors?,default-int
- The content of element type "package" must match "(result-types?,interceptors?,default-intercept .
- The content of element type "package" must match "(result-types?,interceptors?,default-interceptor-r
- struts.xml错误提示:The content of element type "package" must match "(result-types?,interceptors?,defaul
- The content of element type "package" must match "(result-types?,interceptors?,default-intercept .
- The content of element type "package" must match "(result-types?,interceptors?,default-interceptor-r
- struts2 问题 The content of element type "package" must match "(result-types?,interceptors?,
- “The content of element type "package" must match "(result-types?,interceptors?,
- The content of element type "package" must match "(result-types?,interceptors?,default-interceptor-r
- 错误:“The content of element type "package" must match "(result-types?,interceptors?,default-intercept
- The content of element type "package" must match "(result-types?,interceptors?...
- The content of element type "package" must match "(result-types?,interceptors?,default-interceptor-r
- The content of element type "package" must match "(result-types?,interceptors?,default-intercept .
- The content of element type "package" must match "(result-types?,interceptors?,default-interceptor-r
- 内核模块参数例子
- ARM平台设备WinCE下UART配置
- Git使用教程
- IT笔记
- 排序算法
- The content of element type "package" must match "(result-types?interceptors?d
- DOM之节点的基本属性
- javaScript面试题大全
- 欢迎使用CSDN-markdown编辑器
- Android JSONObject对null的处理
- 【JVM】异常和return
- 【Codevs1380】没有上司的舞会【树上最大独立集】【TreeDP】
- greendao使用流程
- Partner2016的第一篇文章