正在加载图片...
3.1使用errorPage指令捕获异常 divArith.jsp <%page errorPage="divError.jsp pageEncoding=GBK"%> <% int dividend=8; int divisor=0; int result=0; try result=dividend/divisor catch (Exception zz){ throw new Exception("除数不能为零!"); }%> 3.1 使用errorPage指令捕获异常 divArith.jsp <%@ page errorPage="divError.jsp“ pageEncoding=GBK"%> <% int dividend = 8; int divisor = 0; int result = 0; try { result= dividend/divisor ; } catch (Exception zz) { throw new Exception( "除数不能为零!" ); }%>
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有