我正在尝试这个JSP程序,但我收到了HTML500错误(找不到页面)



这是我的程序文件。当我把20除以5,我得到答案4好的。对的但当我把20除以0时,我不会得到Aspected Output。相反,我得到的页面无法显示错误HTML 500内部服务器错误。

使用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>

问题出在使用chrome的Internet Explorer上。

最新更新