JSTL If Else Statement : If « JSTL « Java Tutorial

<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
    <title>Using Choose,Otherwise and When</title>

    <c:if test="${pageContext.request.method=='POST'}">Ok, we'll
    <c:out value="${param.enter}" />

      <c:when test="${param.enter=='1'}">pizza.
      <br />

      <br />

    <form method="post">Enter a number between 1 and 5:
    <input type="text" name="enter" />

    <input type="submit" value="Accept" />

    <br />
  Download:  JSTLIfElseStatement.zip( 1,225 k)

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