title: How to set a default page for wrong action requests in struts2?
body: <p>I have followed apache tutorial but the following code runs into error.</p>
  
  <p>Error>>>> </p>
  
  <pre><code>Caused by: org.xml.sax.SAXParseException; systemId:     
  file:/C:/Users/target/Project-1.0/WEB-
  INF/classes/struts.xml; lineNumber: 53; columnNumber: 15; 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>Please note the actions and packages are correctly defined as once I copy the redirect code it runs into error.
  Code </p>
  
  <pre><code>     &lt;package name="default" namespace="/" extends="struts-default"&gt;
  
          &lt;default-action-ref name="UnderConstruction"&gt;&lt;/default-action-ref&gt;
  
              &lt;action name="UnderConstruction"&gt;
                  &lt;result&gt;notFound.jsp&lt;/result&gt;
              &lt;/action&gt;
  
              &lt;result-types&gt;
                  &lt;result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult"/&gt;
              &lt;/result-types&gt;
  
              &lt;action ....&gt;
              &lt;/action&gt;
                ,,,
      &lt;/package&gt;
  </code></pre>
  
  <p>When I change the follwing line </p>
  
  <pre><code> &lt;result&gt;notFound.jsp&lt;/result&gt; 
  </code></pre>
  
  <p>to </p>
  
  <pre><code> &lt;result type="tiles"&gt;notFound.jsp&lt;/result&gt;  
  </code></pre>
  
  <p>the application will be ran but when I enter a wrong address it does not show notFound.jsp page, just throw a not found action exception.</p>
  
  <p>When I try the following code the application runs but it does not redirect the wrong requests to the underconstruction page</p>
  
  <pre><code>    &lt;package name="default" namespace="/" extends="struts-default"&gt;
  
              &lt;result-types&gt;
                  &lt;result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult"/&gt;
              &lt;/result-types&gt;
  
              &lt;action ....&gt;
              &lt;/action&gt;
                ,,,
      &lt;/package&gt;
  
        &lt;package name="Hello" extends="struts-default"&gt;
             &lt;default-action-ref name="UnderConstruction"&gt;&lt;/default-action-ref&gt;
  
              &lt;action name="UnderConstruction"&gt;
                  &lt;result&gt;notFound.jsp&lt;/result&gt;
              &lt;/action&gt;
         &lt;/package&gt;
  </code></pre>