我有一些用于获取页面名称的代码,并且我想将变量与字符串进行比较 - 但该语句始终返回“true”。
<%
String uri = request.getRequestURI();
String pageName = uri.substring(uri.lastIndexOf("/")+1);
%>
<c:if test="${pageName != 'home.html'}" >
<script src="<%= designPath %>/javascripts/constants.js" type="text/javascript"></script>
<script src="<%= designPath %>/javascripts/application.js" type="text/javascript"></script>
<script src="<%= designPath %>/javascripts/cart.js" type="text/javascript"></script>
</c:if>