這是我的程序文件。當我將 20 除以 5 時,我得到答案 4 好的。正確的!但是當我將 20 除以 0 時,我沒有得到方面輸出。相反,我得到頁面無法顯示錯誤 HTML 500 內部服務器錯誤。使用 NetBeans 8.2 和 Internet Explorer。索引.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>流程.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);%>錯誤.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>
添加回答
舉報
0/150
提交
取消