I have a Simple application which I've deployed locally (in a Tomcat), as well as on Google App Engine and Heroku.
The app uses JSTL tags, and they all work fine in all deployments, except the URL tag (<c:url value="/someUrl"/>
) which, only on Heroku, prepends an extra forward slash which screws everything up. Here's what I mean:
<c:url value='/laundryLists/search.htm'/>
In my local Tomcat, where the app is deployed with a context of "testApp" the above code snipped will genreate the following string in the page:
"/testApp/laundryLists/search.htm"
which is correct.
In my GAE deployed app, which sits at address testApp.appspot.com, the above code snippet generates:
"/laundryLists/search.htm"
which is correct, because here the app context is "/" (root)
In my Heroku version, which is deployed at "testApp.herokuapp.com"
The exact same code generates:
"//laundryLists/search.htm" (notice two forward slashes at the beginning)
which is wrong, because if placed in a link, such as
<a href="<c:url value='/laundryLists/search.htm'/>">whatever</a>
the link URL will be:
http://laundryLists/search.htm
which is obviously wrong.
It's worth mentioning that other JSTL tags (such as "forEach") work fine in Heroku.
So my question is, why is this happening on Heroku, and how can I fix it (other than hardcoding the URLS)?