Struts2:全局结果配置错误 [英] Struts2: global-results configuration error
问题描述
我想使用全局结果登录。但它的工作没有全局结果的配置。这是我配置的相关部分:
I want to use a global result "login". But it ony works without global-results in the configuration. This is the relevant part of my configuration:
categoryList.jsp
categoryDetail.jsp
/WEB-INF/login.jsp
categoryList.jsp categoryDetail.jsp /WEB-INF/login.jsp
当我启动我的应用程序时,它抛出此异常:
When I start my application it throws this Exception:
org.xml.sax.SAXParseException:元素类型package的内容必须匹配(结果类型?,拦截器?,default-interceptor-ref ?,默认值-action-ref ?, default-class-ref ?, global-results?,global-exception-mappings?,action *)。
org.xml.sax.SAXParseException: 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*)".
出了什么问题?
推荐答案
知道了!订单很重要。
订单在struts.xml中很重要:
Order in struts.xml matters:
- 结果类型?
- 拦截器?
- default-interceptor-ref?
- default-action- ref?
- default-class-ref?
- global-results?
- global -exception-mappings?
- action *
- result-types?
- interceptors?
- default-interceptor-ref?
- default-action- ref?
- default-class-ref?
- global-results?
- global-exception-mappings?
- action*
这篇关于Struts2:全局结果配置错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!