开发者

Struts2: global-results configuration error

开发者 https://www.devze.com 2023-01-16 21:43 出处:网络
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:

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:

categoryLi开发者_StackOverflow中文版st.jsp categoryDetail.jsp /WEB-INF/login.jsp

When I start my application it throws this Exception:

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*)".

What is wrong?


Got it! The order matters.

Order in struts.xml matters:

  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*


Yes, the tags must be in order : result-types -> interceptors -> default-interceptor-ref -> default-action-ref -> default-class-ref -> global-results -> global-exception-mappings -> action*

0

精彩评论

暂无评论...
验证码 换一张
取 消