使用 if JSTL 调用 javascript 函数



有没有办法用JSTL在if中调用javascript函数?

这是代码

<c:choose>
                <c:when test="${orderUploadAction.errors.size()==0}">
                CALL JS FUNCTION HERE
                </c:when>
                <c:otherwise>
                CALL JS FUNCTION HERE
                </c:otherwise>
</c:choose>

试试这个

<c:choose>
  <c:when test="${orderUploadAction.errors.size()==0}">
     <script> yourFunctionName() </script>
  </c:when>
  <c:otherwise>
     <script> yourAnotherFunctionName() </script>
  </c:otherwise>
</c:choose>

最新更新