如果字符串不相等,该如何比较?


69

我试图只显示基于字符串是否不等于的内容:

<c:if test="${content.getContentType().getName() != "MCE"}">
<li><a href="#publish-history" id="publishHistoryTab">Publish History</a></li>
</c:if>

它不断抛出错误 org.apache.jasper.JasperException: /WEB-INF/jsp/content/manage.jsp(14,60) PWC6212: equal symbol expected

我也试过not eq来代替!=

有效的语法是not equal to什么?


1
尝试“ $ {不(content.getContentType()。getName()eq'MCE')}”。还请注意您使用的引号,因为上面的表达式不正确。
kpentchev 2012年

Answers:


By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.