JSTL If Statement without Body : If « JSTL « Java Tutorial






<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<html>
  <head>
    <title>If with NO Body</title>
  </head>

  <body>
    <c:if test="${pageContext.request.method=='POST'}">
    <c:if test="${param.guess=='5'}" var="result" />

    I tested to see if you picked my number, the result was 
    <c:out value="${result}" />
    </c:if>

    <form method="post">Guess what number I am thinking of?
    <input type="text" name="guess" />

    <input type="submit" value="Try!" />

    <br />
    </form>
  </body>
</html>
  Download:  JSTLIfStatementWithoutBody.zip( 1,226 k)








24.4.If
24.4.1.JSTL If Statement
24.4.2.JSTL If Else Statement
24.4.3.JSTL If With Logical Operator And/Or
24.4.4.JSTL If Statement with True Value
24.4.5.JSTL If Statement without Body
24.4.6.Set Test Result to Variable
24.4.7.NULL value And Boolean