title: Servlet mapping url mapping issue with spring and BIRT
body: <p>In my application I'm using spring MVC(3.0.5) architecture along with BIRT reporting framework.</p>
  
  <p>I'm trying to serve all requests including the static resources like <code>css</code>, <code>js</code>, <code>html</code> and image files using the spring <code>DispatcherServlet</code>.</p>
  
  <p>For this purpose I added the following entries to my web.xml</p>
  
  <pre><code>&lt;servlet&gt;
      &lt;servlet-name&gt;springapp&lt;/servlet-name&gt;
      &lt;servlet-class&gt;
          org.springframework.web.servlet.DispatcherServlet
      &lt;/servlet-class&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  
  ...............
  ...............
  
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;springapp&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>This will direct all request to the <code>DispatcherServlet</code> and in my context file I added</p>
  
  <pre><code>&lt;mvc:resources mapping="/css/**" location="/css/" /&gt;
  &lt;mvc:resources mapping="/docs/**" location="/docs/" /&gt;
  &lt;mvc:resources mapping="/images/**" location="/images/" /&gt;
  &lt;mvc:resources mapping="/js/**" location="/js/" /&gt;
  &lt;mvc:resources mapping="/themes/**" location="/themes/" /&gt;
  </code></pre>
  
  <p>so that these resources will be loaded from the file system.</p>
  
  <p>These configurations are working fine. But I'm facing issues with my BIRT reporting engine now.</p>
  
  <p>The BIRT reporting engine uses some jsp files located in a folder called webcontent which is located at the root of the application. Since we are directing all request to <code>DispatcherServlet</code> even the request for these jsp pages are going to the spring servlet. As I understand from some posts the jsp files are normally handled by <code>org.apache.jasper.servlet.JspServlet</code> which is registered in the Apache Tomcat's <code>web.xml</code> file and it has a servlet mapping as follows</p>
  
  <pre><code>&lt;!-- The mapping for the JSP servlet --&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;jsp&lt;/servlet-name&gt;
      &lt;url-pattern&gt;*.jsp&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;jsp&lt;/servlet-name&gt;
      &lt;url-pattern&gt;*.jspx&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>What are the changes that I should make in my servlet mapping to work in this environment? I need the jsp files to be handled by the default jsp servlet not by the spring servlet. How can I achieve this?</p>
  
  <p>For <a href="http://javapapers.com/servlet/what-is-servlet-mapping/" rel="nofollow">this post</a> I understood that the second priority in servlet matching is for the url prefix, so my url pattern <code>/</code> for spring servelt is overriding the default jsp servlet mapping, Is this assumption correct? If it is correct then how to overcome this?</p>
  
  <p>Thank you.</p>