title: Why does struts.xml have a configuration error?
body: <p>I'm receiving a configuration error in the file <code>struts.xml</code></p>
  
  <p><strong>Error</strong></p>
  
  <pre><code>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*)".
  </code></pre>
  
  <p>What does the error description mean?</p>
  
  <p><strong>struts.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE struts PUBLIC
      "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
      "http://struts.apache.org/dtds/struts-2.0.dtd"&gt;
  
  &lt;struts&gt;
  
      &lt;constant name="struts.devMode" value="true" /&gt;
  
      &lt;package name="basicstruts2" extends="struts-default"&gt;
  
          &lt;global-results&gt;
              &lt;result name="securityerror"&gt;/securityerror.jsp&lt;/result&gt;
              &lt;result name="error"&gt;/error.jsp&lt;/result&gt;
          &lt;/global-results&gt;
  
          &lt;global-exception-mappings&gt;
              &lt;exception-mapping
                  exception="org.apache.struts.register.exceptions.SecurityBreachException"
                  result="securityerror" /&gt;
              &lt;exception-mapping exception="java.lang.Exception"
                  result="error" /&gt;
          &lt;/global-exception-mappings&gt;
  
          &lt;interceptors&gt;
              &lt;interceptor-stack name="appDefaultStack"&gt;
                  &lt;interceptor-ref name="defaultStack"&gt;
                      &lt;param name="exception.logEnabled"&gt;true&lt;/param&gt;
                      &lt;param name="exception.logLevel"&gt;ERROR&lt;/param&gt;
                  &lt;/interceptor-ref&gt;
              &lt;/interceptor-stack&gt;
          &lt;/interceptors&gt;
  
          &lt;default-interceptor-ref name="appDefaultStack" /&gt;
  
          &lt;action name="actionspecificexception" class="org.apache.struts.register.action.Register"
              method="throwSecurityException"&gt;
              &lt;exception-mapping
                  exception="org.apache.struts.register.exceptions.SecurityBreachException"
                  result="login" /&gt;
              &lt;result&gt;/register.jsp&lt;/result&gt;
              &lt;result name="login"&gt;/login.jsp&lt;/result&gt;
          &lt;/action&gt;
  
          &lt;action name="index"&gt;
              &lt;result&gt;/index.jsp&lt;/result&gt;
          &lt;/action&gt;
  
          &lt;!-- If the URL is hello.action the call the execute method of class HelloWorldAction. 
              If the result returned by the execute method is success render the HelloWorld.jsp --&gt;
          &lt;action name="hello"
              class="org.apache.struts.helloworld.action.HelloWorldAction" method="execute"&gt;
              &lt;result name="success"&gt;/HelloWorld.jsp&lt;/result&gt;
          &lt;/action&gt;
  
          &lt;action name="register" class="org.apache.struts.register.action.Register"
              method="execute"&gt;
              &lt;result name="success"&gt;/thankyou.jsp&lt;/result&gt;
              &lt;result name="input"&gt;/register.jsp&lt;/result&gt;
          &lt;/action&gt;
  
          &lt;action name="registerInput" class="org.apache.struts.register.action.Register"
              method="input"&gt;
              &lt;result name="input"&gt;/register.jsp&lt;/result&gt;
          &lt;/action&gt;
  
      &lt;/package&gt;
  
  &lt;/struts&gt;
  </code></pre>