在JSP中使用<jsp:useBean id="testBean" class="" />引用了一个javabean,在调用该BEAN的一个方法时若产生一个testException违例,如何在JSP中捕获它?
<% try {
testBean.test();
} catch (testException e) {
}
%>
JSP没问题啊。
是不是你在定义test()方法时没有throws啊?把你的bean代码贴出来瞧瞧
1、检查在你的testBean.test()是否没有throws testException;
2、检查是否testBean.test()中的throws testException是否永远到达不了。