title: Struts 2 Default Page
body: <p>I have a a web application using struts two that can access a action by literally typing it into the URL</p>
  
  <pre><code>localhost/project/index.action
  </code></pre>
  
  <p>but it won't redirect to this default action without explicitly typing it in.  </p>
  
  <pre><code>localhost/project/
  </code></pre>
  
  <p>gives the error</p>
  
  <pre><code>Error 404: SRVE0190E: File not found: {0}
  </code></pre>
  
  <p>I am assuming the file isn't found because I don't have something configured correctly.  </p>
  
  <p>Can anyone point me in the right direction as for getting this behavior with Struts 2?</p>
  
  <p>Per request here is my struts.xml and web.xml</p>
  
  <p>web.xml</p>
  
  
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app id="WebApp_ID" version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"&gt;
  &lt;display-name&gt;Doc Parser&lt;/display-name&gt;
  
  &lt;filter&gt;
      &lt;filter-name&gt;struts-prepare&lt;/filter-name&gt;
      &lt;filter-class&gt;org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter&lt;/filter-class&gt;
  &lt;/filter&gt;
  &lt;filter&gt;
      &lt;filter-name&gt;struts-execute&lt;/filter-name&gt;
      &lt;filter-class&gt;org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter&lt;/filter-class&gt;
  &lt;/filter&gt;
  &lt;filter&gt;
      &lt;filter-name&gt;sitemesh&lt;/filter-name&gt;
      &lt;filter-class&gt;com.opensymphony.sitemesh.webapp.SiteMeshFilter&lt;/filter-class&gt;
  &lt;/filter&gt;
  
  &lt;filter-mapping&gt;
      &lt;filter-name&gt;struts-prepare&lt;/filter-name&gt;
      &lt;url-pattern&gt;*.action&lt;/url-pattern&gt;
      &lt;url-pattern&gt;/struts/*&lt;/url-pattern&gt;
      &lt;url-pattern&gt;/&lt;/url-pattern&gt;
  &lt;/filter-mapping&gt;
  &lt;filter-mapping&gt;
      &lt;filter-name&gt;sitemesh&lt;/filter-name&gt;
      &lt;url-pattern&gt;*.action&lt;/url-pattern&gt;
      &lt;url-pattern&gt;/struts/*&lt;/url-pattern&gt;
      &lt;url-pattern&gt;/&lt;/url-pattern&gt;
  &lt;/filter-mapping&gt;
  &lt;filter-mapping&gt;
      &lt;filter-name&gt;struts-execute&lt;/filter-name&gt;
      &lt;url-pattern&gt;*.action&lt;/url-pattern&gt;
      &lt;url-pattern&gt;/struts/*&lt;/url-pattern&gt;
      &lt;url-pattern&gt;/&lt;/url-pattern&gt;
  &lt;/filter-mapping&gt;
  
  &lt;listener&gt;
      &lt;listener-class&gt;org.apache.struts2.dispatcher.ng.listener.StrutsListener&lt;/listener-class&gt;
  &lt;/listener&gt;
  
  &lt;servlet&gt;
      &lt;servlet-name&gt;sitemesh-freemarker&lt;/servlet-name&gt;
      &lt;servlet-class&gt;org.apache.struts2.sitemesh.FreemarkerDecoratorServlet&lt;/servlet-class&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;default_encoding&lt;/param-name&gt;
          &lt;param-value&gt;UTF-8&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  &lt;servlet&gt;
      &lt;servlet-name&gt;sitemesh-velocity&lt;/servlet-name&gt;
      &lt;servlet-class&gt;org.apache.struts2.sitemesh.VelocityDecoratorServlet&lt;/servlet-class&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;default_encoding&lt;/param-name&gt;
          &lt;param-value&gt;UTF-8&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  
  
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;sitemesh-freemarker&lt;/servlet-name&gt;
      &lt;url-pattern&gt;*.ftl&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;sitemesh-velocity&lt;/servlet-name&gt;
      &lt;url-pattern&gt;*.vm&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  
  &lt;welcome-file-list&gt;
      &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
  &lt;/welcome-file-list&gt;
  </code></pre>
  
  <p></p>
  
  <p>Strust.xml</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE struts PUBLIC
  "-//Apache Software Foundation//DTD Struts Configuration 2.1.7//EN"
  "http://struts.apache.org/dtds/struts-2.1.7.dtd"&gt;
  </code></pre>
  
  <p>
      
      
      
      </p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;constant name="struts.freemarker.templatesCache" value="true" /&gt;
  
  &lt;constant name="site.framework.roles"
      value="
      free =&gt; http://security.site.com/service/mwstutorial/getItems,
      loggedIn =&gt; http://security.site.com/service/mwstutorial/setItems" /&gt;
  
  &lt;package name="blank" extends="default"&gt;
  
  &lt;/package&gt;
  </code></pre>
  
  <p></p>