Reputation: 2025
is it possible to get the context path in a class extending SimpleTagSupport? or is it actually necessary to pass it as a parameter to my tag?
Upvotes: 0
Views: 1670
Reputation: 111
Try this :
ServletContext servletContext = ((PageContext) getJspContext()).getServletContext();
String appContext = servletContext.getContextPath();
Upvotes: 2
Reputation: 3724
I hope this will help you. In jsp view files
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
Upvotes: 0