我有需要检查的变量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)
请尝试以下方法:
<c:if test="${not fn:contains(x, y) && fn:contains(x, z)}">
</c:if>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2119 次 |
| 最近记录: |