I have made my application to run as root in tomcat using This post.
Now my application coming in browser as http://localhost:8080/
instead of http://localhost:8080/myApp/
As i Expected.
I have single menubar at the top which is same for every page using <%@include file="/jsp/header.jsp" %>
There is home button what will bring user to the home page from any level of url like http://localhost:8080/a
http://localhost:8080/a/b/c
all to http://localhost:8080/
.
before making my app root i was using
<a class="...." href="${pageContext.request.contextPath}">Home</a>
But now ${pageContext.request.contextPath}
value is and empty string()
. so the generate html is
<a href="" class="...."></a>
Which is only reloading the current page when clicked.
What should i do to make it work like before. And i would like to make it server independent (now it is in local host some day it will go to a real serve i hope).