title: Struts2 and Jetty welcome-file-lists
body: <p>I am trying to get a Struts2 webapp and Jetty to play well. For some reason with Struts interceptors and FilterDispatcher configured my welcome file never get picked up I always encounter a 404. I have index.jsp in my webapp but for some reason when accessing <a href="http://localhost/webapp" rel="nofollow">http://localhost/webapp</a> I always encounter 404.</p>
  
  <p>For now I have set default-action-ref to my index.jsp in struts.xml but this means even for really non-existent files the user would get redirected to the index page. Is there a cleaner way to ensure Jetty picks up the welcome file? The welcome file gets picked up if the struts FilterDispatcher is <strong>not</strong> used, so I reckon it has got something to do with the way struts is configured?</p>
  
  <p>The web.xml is a fairly standard web.xml with nothing fancy(?!). As I said earlier, I suspect it has got something to do with the struts.xml configuration.</p>
  
  <p>struts.xml:
  <code></p>
  
  <p>
  </p>
  
  <pre><code>&lt;constant name="struts.serve.static" value="true"/&gt;
  &lt;constant name="struts.codebehind.pathPrefix" value="/WEB-INF/pages/"/&gt;
  &lt;constant name="struts.configuration.classpath.defaultParentPackage" value="cms-default"/&gt;
  &lt;constant name="struts.objectFactory" value="org.apache.struts2.spring.StrutsSpringObjectFactory"/&gt;
  &lt;constant name="struts.custom.i18n.resources" value="cms-messages,cms-version"/&gt;
  &lt;constant name="struts.multipart.maxSize" value="31457280"/&gt;
  
  &lt;package name="cms-default" extends="codebehind-default"&gt;
  
      &lt;interceptors&gt;
  
          &lt;interceptor-stack name="cmsStack"&gt;
              &lt;interceptor-ref name="alias" /&gt;
              &lt;interceptor-ref name="params" /&gt;
              &lt;interceptor-ref name="servletConfig" /&gt;
              &lt;interceptor-ref name="prepare" /&gt;
              &lt;interceptor-ref name="i18n" /&gt;
              &lt;interceptor-ref name="chain" /&gt;
              &lt;interceptor-ref name="modelDriven" /&gt;
              &lt;interceptor-ref name="fileUpload" /&gt;
              &lt;interceptor-ref name="checkbox" /&gt;
              &lt;interceptor-ref name="staticParams" /&gt;
              &lt;interceptor-ref name="conversionError" /&gt;
              &lt;interceptor-ref name="validation"&gt;
                  &lt;param name="excludeMethods"&gt;input,back,cancel&lt;/param&gt;
              &lt;/interceptor-ref&gt;
              &lt;interceptor-ref name="workflow"&gt;
                  &lt;param name="excludeMethods"&gt;input,back,cancel&lt;/param&gt;
              &lt;/interceptor-ref&gt;
          &lt;/interceptor-stack&gt;
      &lt;/interceptors&gt;
  
      &lt;default-interceptor-ref name="cmsStack" /&gt;
      &lt;default-action-ref name="index"&gt;&lt;/default-action-ref&gt;
  
      &lt;global-results&gt;
          &lt;result name="redirectToUrl" type="redirect"&gt;${redirectedToURL}&lt;/result&gt;
      &lt;/global-results&gt;
  
      &lt;action name="index"&gt;
          &lt;result&gt;/index.jsp&lt;/result&gt;
      &lt;/action&gt;
  
  &lt;/package&gt;
  </code></pre>
  
  <p></p>
  
  <p></code></p>
  
  <p>FWIW, The problems I am encountering are almost the same ones mentioned in <a href="http://archive.codehaus.org/lists/org.codehaus.jetty.user/msg/4A9E1B5C.6060506@gmail.com" rel="nofollow">this</a> email thread.</p>
  
  <p><strong>Updated</strong> With more information about the setup. Yeah the name webapp was just an example :)</p>