RDS
#1
Pessoal como eu faço para pegar o path dentro do if?
Fiz dessa form mas não deu certo?
[code]<c:set var=“site” value=“document.location.pathname”/>
<c:if test="${fn:contains(site, 'tivit')}">
<p>Found test string</p>
</c:if>
<c:if test="${fn:contains(site, 'caixa')}">
<p>Found TEST string</p>
</c:if>[/code]
Alguem poderia me dar uma orientação ? Obrigado
Tenta assim:
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
request.setAttribute("basePath", basePath);
%>
<c:set var="site" value="<%=basePath%>"/>
<c:if test="${fn:contains(site, 'tivit')}">
<p>Found test string</p>
</c:if>
<c:if test="${fn:contains(site, 'caixa')}">
<p>Found TEST string</p>
</c:if>