Testing Which Page Loaded your JSP Page Fragment
by Frank Kim on Feb.01, 2010, under JSTL
Sometimes you want to check in your JSP page fragment which page loaded it. Fortunately this is simple with JSTL.
<c:if test="${fn:indexOf(pageContext.request.requestURI,'foo.jsp') != -1}">
The request URI ${pageContext.request.requestURI} contains foo.jsp.
</c:if>
Simple but something I always forget how to do.
Related posts:
