我需要在JSP中执行按位测试,但不能在我的生活中弄清楚如何使用EL来完成。如何在JSTL if语句中执行按位逻辑?
我想要做的事,如:
<c:if test="${(test & testFor) == testFor}">
<h3>Test Passed</h3>
</c:if>
我当然可以用普通的JSP语法做到这一点:
<% if ((test & testFor) == testFor) { %>
<h3>Test Passed</h3>
<% } %>
进行按位测试的EL功能确实要走的路。你可以在这里找到示例(http://stackoverflow.com/questions/3472699/jstl-fmt-library-throws-500-error-requires-sessions-enabled/3472823#3472823),[here](http:/ /stackoverflow.com/questions/2752949/jsp-2-0-seo-friendly-links-encoding/2753495#2753495)和[这里](http://stackoverflow.com/questions/2523430/hidden-features-of- JSP-的servlet/2525995#2525995)。 – BalusC 2010-08-13 12:47:47
Thankyou非常感谢您的帮助BalusC,非常感谢。 – 2010-08-13 12:51:54
不客气。 – BalusC 2010-08-13 16:38:55