On Mon, 23 Sep 2002, Bhiogade, Mittal S (SUPP) wrote:

>     Is there any Tag Library for "IF -ELSE-IF or IF-ELSE" , I have
> found the "IF" Tag Library at jakarata, Thanks in Advance

The standard JSTL tags support simple conditionals with <c:if> and complex
conditions with <c:choose>, <c:when>, and <c:otherwise>.  The expert group
debated this at length and found the latter model to be better than a
syntactically odd <c:else> tag.

Usage works like this:

 <c:if test="${user.iq > 150}">
  You seem like a pretty smart guy.
 </c:if>

And:

 <c:choose>
  <c:when test="${user.iq < 100}">
    below average
  </c:when>
  <c:when test="${user.iq < 120}">
    moderate
  </c:when>
  <c:otherwise>
    intelligent
  </c:otherwise>
 </c:choose>

See the JSTL spec for more information; also, all JSTL books should cover
this material in detail.  Hope that helps,

--
Shawn Bayern
"JSTL in Action"   http://www.jstlbook.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to