Meaningless Drivel is fun!*
The moose likes Struts and the fly likes Struts 2: error on adding <global-exception-mappings> tag to struts.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2: error on adding <global-exception-mappings> tag to struts.xml " Watch "Struts 2: error on adding <global-exception-mappings> tag to struts.xml " New topic
Author

Struts 2: error on adding <global-exception-mappings> tag to struts.xml

vikas sharmaa
Ranch Hand

Joined: Jun 28, 2007
Posts: 191
i am getting below error after adding <global-exception-mappings> tag to struts.xml file for exception handling:

ERROR [main] (CommonsLogger.java:27) - The content of element type "package" mus
t match "(result-types?,interceptors?,default-interceptor-ref?,default-action-re
f?,default-class-ref?,global-results?,global-exception-mappings?,action*)". at (
null:28:12)

below is my struts.xml file:



on removing <global-exception-mappings> tag my application is working. please tell me where am going wrong. thanks.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

What about the error message don't you understand? It's telling you exactly what's wrong and how to fix it.
vikas sharmaa
Ranch Hand

Joined: Jun 28, 2007
Posts: 191
newton,

it is saying that content of element type package must match result-types?,interceptors?,default-interceptor-ref?,default-action-re
f?,default-class-ref?,global-results?,global-exception-mappings?,action*

it means, <global-exception-mappings> tag is allowed under package tag. then why the error?
vikas sharmaa
Ranch Hand

Joined: Jun 28, 2007
Posts: 191
i need to write it below the result types. thanks
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Struts 2: error on adding <global-exception-mappings> tag to struts.xml
 
Similar Threads
ERROR convention.PackageBasedActionConfigBuilder - Unable to load class
TokenSession Interceptor
Issue configuring global results
struts2 + interceptor
struts2 action from tiles definition fired multiple times