我正在尝试这个 JSP 程序,但收到 HTML 500 错误(未找到页面)

这是我的程序文件。当我将 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>


皈依舞
浏览 62回答 1
1回答

慕侠2389804

问题出在 Internet Explorer 上,chrome 可以正常工作。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Html5