這是我的程序文件。當(dāng)我將 20 除以 5 時(shí),我得到答案 4 好的。正確的!但是當(dāng)我將 20 除以 0 時(shí),我沒有得到方面輸出。相反,我得到頁(yè)面無法顯示錯(cuò)誤 HTML 500 內(nèi)部服務(wù)器錯(cuò)誤。使用 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);%>錯(cuò)誤.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>
- 1 回答
- 0 關(guān)注
- 105 瀏覽
添加回答
舉報(bào)
0/150
提交
取消