JSTL: catch Exception : Exceptions « JSTL « Java

JSTL: catch Exception

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

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

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

      <c:when test="${signalException != null}">
        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 with if