JSTL: Catch with if : Exceptions « JSTL « Java

JSTL: Catch with if

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

  int i= (int) (Math.random() * 10);
  pageContext.setAttribute("signalStrength", new Integer(i), PageContext.PAGE_SCOPE);

    <title>The c:catch action</title>
    <c:if test="${pageScope.signalStrength < 5}">
      <c:set var="signalFailure" value="true" scope="page" />

      <c:when test="${pageScope.signalFailure == true}">
        Exception occurs.
        No Exception.


Related examples in the same category

1.JSTL Throw an Exception
2.Catch an Exception?
3.Catch an Exception in JSTL
4.JSTL Exception: UnCaught Exception
5.JSTL: catch Exception