如果字符串不等于,我该如何比较



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

<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的有效语法是什么?

!=ne都可以工作,但您需要对访问器语法和嵌套引号进行排序。

<c:if test="${content.contentType.name ne 'MCE'}">
    <%-- snip --%>
</c:if>

最新更新