使用NetBeans 8.2和Internet Explorer。index.html
<form action="process.jsp">
No1:<input type="text" name="n1" /><br/><br/>
No2:<input type="text" name="n2" /><br/><br/>
<input type="submit" value="divide"/></form>
process.jsp
<%@page errorPage="error.jsp" %> <% String num1=request.getParameter("n1"); String num2=request.getParameter("n2"); int a=Integer.parseInt(num1); int b=Integer.parseInt(num2); int c=a/b; out.print("division of numbers is: "+c); %>
error.jsp
<%@page isErrorPage="true" %> <html> <body> An unexpected exception was encountered. The admin monkeys are looking into the issue. <br><br> Exception is : <%= exception %> </body> </html>