C:Catch Exception : Exception « JSTL « Java Tutorial

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

    <title>The c:catch action</title>
    <h1>So you want to make a call from your cell phone?!</h1>
    <h2>Checking the signal strength...</h2>

    <c:catch var="signalException">
        int i= (int) (Math.random() * 10);

        if (i < 5 )
          throw new NullPointerException(); %>

      <c:when test="${signalException != null}">
        No Exception!!!
  Download:  JSTLCCatchException.zip( 1,021 k)

24.13.1.Generate Exception in c:out
24.13.2.C:Catch Exception
24.13.3.Catch Exception and Print Out Exception Message
24.13.4.Catch Exception
24.13.5.Catch Error