以下哪一项更好? c:set var="var1" value="false" scope="request"/c:if test="${someCondition}" c:set var="var1" value="true" scope="request"//c:if 或者以下 c:choose c:when test="${someCondition}" c:set var="var1" value="true" scop
<c:set var="var1" value="false" scope="request"/> <c:if test="${someCondition}"> <c:set var="var1" value="true" scope="request"/> </c:if>
或者以下
<c:choose> <c:when test="${someCondition}"> <c:set var="var1" value="true" scope="request"/> </c:when> <c:otherwise> <c:set var="var1" value="false" scope="request"/> <c:otherwise> </c:choose>这两件事看起来都不错:
<c:set var="var1" value="${someCondition}" scope="request"/>