| |
24. 13. 3. 打印出异常消息 |
|
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<html>
<head>
<title>Catch an Exception</title>
</head>
<body>
<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 />
</c:catch>
<br />
<c:if test="${e!=null}">The caught exception is:
<c:out value="${e}" />
<br />
</c:if>
<c:if test="${e==null}">No exception was thrown
<br />
</c:if>
</body>
</html>
|
|
Download: JSTLCatchExceptionAndPrintOutExceptionMessage.zip( 1,227 k) |
24. 13. 例外 | | 24. 13. 1. | 产生异常 | | | | 24. 13. 2. | 捕获异常 | | | | 24. 13. 3. | 打印出异常消息 | | | | 24. 13. 4. | 捕获异常 | | | | 24. 13. 5. | 捕获错误 | | |
|