a definition
This tag is used to catch exceptions thrown by tags nested within it.
Two actual combat
<%@
page
language
=
"java"
import
=
"java.util.*,com.cakin.domain.*"
pageEncoding
=
"utf-8"
%>
<!-- Introduce
jstl
tag library -->
<!
DOCTYPE
html
PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
"
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
;
>
<
html
>
<
head
>
<
title
>
My JSP 'c_out.jsp' starting page
</
title
>
</
head
>
<
body
>
<
h3
>
Use of c:catch
</
h3
>
<
c:catch
var
=
"myexception"
>
<%
int
i = 8/0;
%>
</
c:catch
>
<
c:out
value
=
"
${myexception}
"
></
c:out
>
</
body
>
</
html
>
Three test results
![](http://dl2.iteye.com/upload/attachment/0127/6362/e06e6f7c-a9a3-3180-a232-80931a76861e.png)