Catch an Exception in JSTL : Exceptions « JSTL « Java

Catch an Exception in JSTL

<%@ taglib uri="" prefix="c" %>
    <title>Catch an Exception</title>

    <c:catch var="e">
    <c:set var="x" value="10" scope="page" />

    <c:set var="y" value="five" scope="page" />

    x divided by y is 
    <c:out value="${x/y}" />

    <br />

    <br />
    <c:if test="${e!=null}">The caught exception is:
    <c:out value="${e}" />

    <br />

    <c:if test="${e==null}">No exception was thrown
    <br />

       853 k)

Related examples in the same category

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