After creating a Java webapp on Tomcat servers, for which I just used http://localhost:8080/file
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 http://url.com/webapp/file
This means, since I made every url in a way in which it only works when going directly to url.com/file
, my webapp won't work on the deployment server.
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 web.xml-mapping
?
Edit:
My web.xml
maps servlets in the following way:
<servlet>
<servlet-name>Batch</servlet-name>
<servlet-class>servlets.BatchCreateServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>questionOverview</servlet-name>
<jsp-file>/questionOverview.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>Batch</servlet-name>
<url-pattern>/create-batch</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>questionOverview</servlet-name>
<url-pattern>/question-overview</url-pattern>
</servlet-mapping>
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).