Hello,

I created a very simple application in order to test exception handling.
Unfortunately when I add a global-exception-mappings tag to my
struts.xml (see file below) the application is not even deployed
anymore, and here is what Tomcat complains about:

The content of element type "package" must match
"(result-types?,interceptors?,default-interceptor-ref?,default-action-ref?,global-results?,global-exception-mappings?,action*)".
-
file:/opt/tomcat/5.5.23/webapps/playground/WEB-INF/classes/struts.xml:22:15

Well, line 22 is the package closing tag and to me it seems like my
struts.xml matches the DTD very well, in fact I only use an action and a
global-exception-mappings tag inside of the package. The funny thing is
that when I remove the action tag the app is deployed perfectly well, it
just does not have any actions then. I am pretty sure there is something
I do not know/understand yet. Can you tell what the problem might be?

06: <struts>
07:     <package name="playground-default" extends="struts-default">
08:
09:         <action name="ExceptionThrower"
10:                 class="action.ExceptionThrower">
11:             <result>/exceptionHandling.jsp</result>
12:             <result name="input">/exceptionHandling.jsp</result>
13:             <result name="error">/error.jsp</result>
14:         </action>
15:
16:         <global-exception-mappings>
17:             <exception-mapping
18:                     result="error"
19:                     exception="java.lang.Throwable"/>
20:         </global-exception-mappings>
21:
22:     </package>
23: </struts>

Best,
Anton

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to