Deploy Java web application to real Tomcat server doesn't work
<p>After creating a Java webapp on Tomcat servers, for which I just used <code>http://localhost:8080/file</code> as an URL, I need to host my webapp on a deployment server. This server hosts multiple projects, so my webapp needs to be deployed to <code>http://url.com/webapp/file</code></p>

<p>This means, since I made every url in a way in which it only works when going directly to <code>url.com/file</code>, my webapp won't work on the deployment server.</p>

<p>Is there an easy way to change every URL in my project to be able to handle the additional bit of path in the URL or do I need to change every URL seperately in the <code>web.xml-mapping</code>?</p>

<p>Edit:</p>

<p>My <code>web.xml</code> maps servlets in the following way:</p>

<pre><code>&lt;servlet&gt;
    &lt;servlet-name&gt;Batch&lt;/servlet-name&gt;
    &lt;servlet-class&gt;servlets.BatchCreateServlet&lt;/servlet-class&gt;
&lt;/servlet&gt;

&lt;servlet&gt;
    &lt;servlet-name&gt;questionOverview&lt;/servlet-name&gt;
    &lt;jsp-file&gt;/questionOverview.jsp&lt;/jsp-file&gt;
&lt;/servlet&gt;

&lt;servlet-mapping&gt;
    &lt;servlet-name&gt;Batch&lt;/servlet-name&gt;
    &lt;url-pattern&gt;/create-batch&lt;/url-pattern&gt;
&lt;/servlet-mapping&gt;

&lt;servlet-mapping&gt;
    &lt;servlet-name&gt;questionOverview&lt;/servlet-name&gt;
    &lt;url-pattern&gt;/question-overview&lt;/url-pattern&gt;
&lt;/servlet-mapping&gt;
</code></pre>

<p>In the process of creating more jsp-files, the file became very long, so this is merely a shard of the entire file (which makes editing all the mappings a very annoying and tedious job).</p>