I am using JSTL c:url tag to define my URL’s in the application, something like:
<c:url value"/home" />
But the problem is that it appends the application context to the url, so the link becomes http://appName.come/appName/page while it should be http://appName.come/page.
The link had to be with slash, because it’s not relative. I want to prevent the application context from being added or something like that, any ideas?
That’s just the sole purpose of
c:url: adding the context root and if necessary jsessionid whenever client doesn’t support cookies. It also has support for URL-encoding the query parameters byc:param. If you don’t want to have that, then just don’t usec:urlbut use a plain HTML<a>element instead.Update: as per the comment you seem to want to have the jsessionid in the URL (do you realize that the sessions are by default not shared between contexts and that you have to configure the serletcontainer accordingly?). In that case, manually set the
contextattribute.