使用JSTL评估多个fn:contains()条件

Jon*_*rte 3 java jsp jstl

我有需要检查的变量x,它不包含变量y,但确实包含变量z。如何使用JSTL做到这一点?尝试将语句包装在另一个语句中,但是似乎没有注册。它仅响应第一次评估。

 <c:if test="${not fn:contains('x', 'y')}">
     <c:if test="${fn:contains('x', 'z')}">

     </c:if>
 </c:if>
Run Code Online (Sandbox Code Playgroud)

如果可以执行以下操作,那将是很好:

 <c:if test="${fn:contains('x', 'z', not 'y')}">
Run Code Online (Sandbox Code Playgroud)

Koh*_*URA 5

请尝试以下方法:

<c:if test="${not fn:contains(x, y) && fn:contains(x, z)}">

</c:if>
Run Code Online (Sandbox Code Playgroud)