title: Struts 2 + Maven + Struts 2 Rest Plugin help
body: <p>Hi I am new to Struts 2 and all the java web development, I created a basic struts2 application using maven and then added the struts2-rest-plugin to build my project; here is pom.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project&gt;
   &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
   &lt;groupId&gt;tutorial&lt;/groupId&gt;
   &lt;artifactId&gt;tutorial&lt;/artifactId&gt;
   &lt;packaging&gt;war&lt;/packaging&gt;
   &lt;version&gt;0.1&lt;/version&gt;
   &lt;name&gt;Struts 2 Starter&lt;/name&gt;
   &lt;url&gt;http://www.myComp.com&lt;/url&gt;
   &lt;description&gt;Struts 2 Starter&lt;/description&gt;
  
   &lt;dependencies&gt;
    &lt;!-- Junit --&gt;
    &lt;dependency&gt;
     &lt;groupId&gt;junit&lt;/groupId&gt;
     &lt;artifactId&gt;junit&lt;/artifactId&gt;
     &lt;version&gt;3.8.1&lt;/version&gt;
     &lt;scope&gt;test&lt;/scope&gt;
    &lt;/dependency&gt;
  
    &lt;!--  Struts 2 --&gt;
    &lt;dependency&gt;
              &lt;groupId&gt;org.apache.struts&lt;/groupId&gt;
              &lt;artifactId&gt;struts2-core&lt;/artifactId&gt;
              &lt;version&gt;2.1.6&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.struts&lt;/groupId&gt;
              &lt;artifactId&gt;struts2-spring-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.1.6&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
           &lt;groupId&gt;org.apache.struts&lt;/groupId&gt;
           &lt;artifactId&gt;struts2-convention-plugin&lt;/artifactId&gt;
           &lt;version&gt;2.1.6&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
           &lt;groupId&gt;org.apache.struts&lt;/groupId&gt;
           &lt;artifactId&gt;struts2-rest-plugin&lt;/artifactId&gt;
           &lt;version&gt;2.1.6&lt;/version&gt;
          &lt;/dependency&gt;
  
  
    &lt;!-- Servlet &amp; Jsp --&gt;
    &lt;dependency&gt;
     &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
     &lt;artifactId&gt;servlet-api&lt;/artifactId&gt;
     &lt;version&gt;2.4&lt;/version&gt;
     &lt;scope&gt;provided&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
     &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
     &lt;artifactId&gt;jsp-api&lt;/artifactId&gt;
     &lt;version&gt;2.0&lt;/version&gt;
     &lt;scope&gt;provided&lt;/scope&gt;
    &lt;/dependency&gt;
  
    &lt;!-- Jakarta Commons --&gt;
    &lt;dependency&gt;
     &lt;groupId&gt;commons-fileupload&lt;/groupId&gt;
     &lt;artifactId&gt;commons-fileupload&lt;/artifactId&gt;
     &lt;version&gt;1.1.1&lt;/version&gt;
    &lt;/dependency&gt;
  
    &lt;!-- Dwr --&gt;
    &lt;dependency&gt;
     &lt;groupId&gt;uk.ltd.getahead&lt;/groupId&gt;
     &lt;artifactId&gt;dwr&lt;/artifactId&gt;
     &lt;version&gt;1.1-beta-3&lt;/version&gt;
    &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;build&gt;
        &lt;finalName&gt;tutorial&lt;/finalName&gt;
       &lt;plugins&gt;
        &lt;plugin&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;configuration&gt;
                     &lt;source&gt;1.5&lt;/source&gt;
                     &lt;target&gt;1.5&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
        &lt;plugin&gt;
         &lt;groupId&gt;org.mortbay.jetty&lt;/groupId&gt;
         &lt;artifactId&gt;maven-jetty-plugin&lt;/artifactId&gt;
         &lt;version&gt;6.1.5&lt;/version&gt;
         &lt;configuration&gt;
          &lt;scanIntervalSeconds&gt;10&lt;/scanIntervalSeconds&gt;
         &lt;/configuration&gt;
        &lt;/plugin&gt;
       &lt;/plugins&gt;
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>the web.xml and struts.xml are as following:</p>
  
  <p><strong>web.xml:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app id="starter" version="2.4" 
           xmlns="http://java.sun.com/xml/ns/j2ee" 
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
           xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"&gt;
  
   &lt;display-name&gt;Struts 2 - Maven Archetype - Starter&lt;/display-name&gt;
  
   &lt;context-param&gt;
    &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
    &lt;param-value&gt;classpath*:applicationContext*.xml&lt;/param-value&gt;
   &lt;/context-param&gt;
  
   &lt;!-- Filters --&gt;
      &lt;filter&gt;
          &lt;filter-name&gt;action2&lt;/filter-name&gt;
          &lt;filter-class&gt;org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter&lt;/filter-class&gt;
          &lt;!-- filter-class&gt;org.apache.struts2.dispatcher.FilterDispatcher&lt;/filter-class--&gt;
      &lt;/filter&gt;
  
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;action2&lt;/filter-name&gt;
          &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
      &lt;/filter-mapping&gt;
  
   &lt;!-- Listeners --&gt; 
   &lt;listener&gt;
          &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
      &lt;/listener&gt;
  
      &lt;!-- Welcome file lists --&gt;
      &lt;welcome-file-list&gt;
          &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
          &lt;welcome-file&gt;default.jsp&lt;/welcome-file&gt;
          &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
      &lt;/welcome-file-list&gt;
  
  &lt;/web-app&gt;
  </code></pre>
  
  <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.convention.action.suffix" value="Controller"/&gt;
   &lt;constant name="struts.convention.action.mapAllMatches" value="true"/&gt;
   &lt;constant name="struts.convention.default.parent.package" value="rest-default"/&gt;
   &lt;constant name="struts.convention.package.locators" value="example"/&gt;
  
  &lt;/struts&gt;
  </code></pre>
  
  <p>Now I have package <code>org.apache.struts2.rest.example</code> with class <code>OrdersController.java</code> (taken from the struts2-rest-showcase example); <strong>running mvn jetty:run</strong> and hitting url: <strong><a href="http://localhost:8080/tutorial/orders/" rel="nofollow noreferrer">http://localhost:8080/tutorial/orders/</a></strong> results in Error 404;</p>
  
  <p><strong>What's wrong that I am doing?</strong></p>