<p>in web.xml i set my welcome file to a jsp within web.xml</p>

<pre><code>&lt;welcome-file&gt;WEB-INF/index.jsp&lt;/welcome-file&gt;
</code></pre>

<p>inside index.jsp i then forward on to a servlet </p>

<pre><code>&lt;% response.sendRedirect(response.encodeRedirectURL("myServlet/")); %&gt;
</code></pre>

<p>however the application tries to find the servlet at the following path </p>

<pre><code>applicationName/WEB-INF/myServlet
</code></pre>

<p>the problem is that web-inf should not be in the path. If i move index.jsp out of web-inf then the problem goes but is there another way i can get around this?</p>

Doh - there is an option on the jasper2 task to auto-merge the fragment into the main web.xml -
addWebXmlMappings
```
```
<jasper2
         validateXml="false"
         uriroot="${web.dir}"
         addWebXmlMappings="true"
         webXmlFragment="${web.dir}/WEB-INF/classes/jasper_generated_web.xml"
         outputDir="${web.dir}/WEB-INF/jsp-src" />
```
```
I wonder how good the merge is...
Annoyingly you need to generate the fragment still, even though its not needed after this task.