विशेषता
| विशेषता | <वें शैली ="पाठ-संरेखण:केंद्र;">विवरणआवश्यक | <वें शैली="पाठ्य-संरेखण:केंद्र;">डिफ़ॉल्टवें>||
|---|---|---|---|
| var | जावा.लैंग को होल्ड करने के लिए वैरिएबल का नाम। शरीर में तत्वों द्वारा फेंके जाने पर फेंकने योग्य। | नहीं | कोई नहीं |
उदाहरण
<%@ taglib uri = "http://java.sun.com/jsp/jstl/core" prefix = "c" %>
<html>
<head>
<title><c:catch> Tag Example</title>
</head>
<body>
<c:catch var ="catchException">
<% int x = 5/0;%>
</c:catch>
<c:if test = "${catchException != null}">
<p>The exception is : ${catchException} <br />
There is an exception: ${catchException.message}</p>
</c:if>
</body>
</html> उपरोक्त कोड निम्नलिखित परिणाम उत्पन्न करेगा -
The exception is : java.lang.ArithmaticException: / by zero There is an exception: / by zero