Tuesday, October 6, 2009

How to get the root context of a web application

<%=request.getContextPath()%>



Or with jstl:



<c:out value="${pageContext.request.contextPath}">



For portlets you can also use renderRequest.contextPath, however the page must have include <portlet:defineObjects/>