2016-09-21 62 views
1

error.jsp文件爲什麼IDE內部瀏覽器給HTTP 500內部服務器錯誤

<body> 
    <%@ page isErrorPage="true"%> 

    <h2>Sorry, your application generating an exception</h2> 

    Exception is : <%=exception %> 

</body> 

的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.println("Division of numbers is : "+c); 
    %> 

當我devide任意數量由零IDE內部網頁瀏覽器給「Http 500服務器內部錯誤),當我改變網頁瀏覽器它給我正確的輸出

+0

jrbeddard你能回答我的問題嗎 –

回答

0

我發現IE默認打開了一項功能 - 顯示友好的HTTP錯誤信息(轉到工具 - > internet選項 - >高級 - >取消選中顯示友好的HTTP錯誤信息)。然後在Eclipse IDE中執行 。爲我工作!