If with Body : If « JSTL « Java

If with Body

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

    <c:if test="${pageContext.request.method=='POST'}">
      <c:if test="${param.guess=='5'}">You guessed my number!
      <br />

      <br />

      <br />

      <c:if test="${param.guess!='5'}">You did not guess my number!
      <br />

      <br />

      <br />

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

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

    <br />


JSTL-IfWithBody.zip( 851 k)

Related examples in the same category

1.JSTL core tag: if
3.JSTL: If Else
4.JSTL If No Body
5.JSTL: if tag