betweenGo

JSTL for current URI

by on May.27, 2008, under JSTL

I was wondering how do get the current URI using JSTL and found this forum thread, JSTL EL for current page URL?.

If you want the actual URI of the JSP that is being rendered:

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

If you want the original URI, which is probably the case, then:

<c:out value="${requestScope['javax.servlet.forward.request_uri']}"/>

In DSP if you want the original URI you can use the OriginatingRequest bean which implements the HttpServletRequest.

<dsp:valueof bean="/OriginatingRequest.requestURI" />


Share

Related posts:

  1. Get JSTL Vars from PageContext
  2. Upgrading to JSTL 1.1
  3. Accessing RepositoryItems with JSTL
  4. Encode URI
  5. Test if empty in JSTL

:, , ,

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!