73

我试图仅根据字符串是否不等于以下内容来显示某些内容:

<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什么?

4

1 回答 1

145

要么 要么!=ne工作,但您需要整理访问器语法和嵌套引号。

<c:if test="${content.contentType.name ne 'MCE'}">
    <%-- snip --%>
</c:if>
于 2012-08-27T14:57:31.277 回答