Mega Code Archive

 
Categories / Java Tutorial / JSTL
 

C

<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <html>   <head>     <title>The c:catch action</title>   </head>   <body>     <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:catch>     <c:choose>       <c:when test="${signalException != null}">                  Exception!!!       </c:when>       <c:otherwise>         No Exception!!!       </c:otherwise>     </c:choose>   </body> </html>