We are trying to make the code cleaner while still supporting deploying the same app into different contexts under Tomcat.
The best solution so far we found is to use the <base href="PATH" /> in the <head> section, and then make all the links inside the html relative to that base path.
The code then would look like:
<base href="http://mysite.com/qa" />
<link rel="stylesheet" href="css/style.css">
And we are using the same approach for all the other links inside all JSP files.
It works just fine in Tomcat.
But then we get a problem with navigating to all those relative links in Idea. Whenever we click on such a link we get "Can not find declaration to go to". Changing links to <link rel="stylesheet" href="/css/style.css"> of course works for Idea navigation, but then it doesn't work under Tomcat =)
Is there any way to make Idea using project Web Resource Directory setting as a prefix to resolve all these relative links? Or if there is any other solution to make navigation working with these relative links.