Struts2:全局结果配置错误 [英] Struts2: global-results configuration error

查看:160
本文介绍了Struts2:全局结果配置错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用全局结果登录。但它的工作没有全局结果的配置。这是我配置的相关部分:

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
categoryDe​​tail.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:


  1. 结果类型?

  2. 拦截器?

  3. default-interceptor-ref?

  4. default-action- ref?

  5. default-class-ref?

  6. global-results?

  7. global -exception-mappings?

  8. action *

  1. result-types?
  2. interceptors?
  3. default-interceptor-ref?
  4. default-action- ref?
  5. default-class-ref?
  6. global-results?
  7. global-exception-mappings?
  8. action*

这篇关于Struts2:全局结果配置错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆