• Post Reply Bookmark Topic Watch Topic
  • New Topic

Replacement for request.getContextPath()

 
Jacob Fenwick
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I often concatenate together a url for some javascript or an anchor tag. I usually use <%=request.getContextPath()%> to get the absolute path, as javascript/html has no knowledge of the context. I want to avoid using scriptlets. Is there an equivalent in tags/EL?
If not, is there such a tags in JSF/Struts?
 
Jacob Fenwick
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nevermind, I just answered my own question with c:url
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65522
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's also available from the EL as ${pageContext.request.contextPath}
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!