betweenGo

Testing Which Page Loaded your JSP Page Fragment

by Frank Kim on Feb.01, 2010, under JSTL

Zen Water on Flickr

Zen Water by darkpatator

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. :-)


  • Share/Bookmark

Related posts:

  1. JSTL for current URI
  2. Get JSTL Vars from PageContext
  3. JSP redirect to another page
  4. Size of collection in a JSP/DSP page
  5. Getting the request parameter


Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!