AntonS
AntonS

Reputation: 700

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

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?

Upvotes: 2

Views: 4773

Answers (2)

AntonS
AntonS

Reputation: 700

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*

Upvotes: 7

hieund
hieund

Reputation: 370

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*

Upvotes: 0

Related Questions