J2EE:error in displaying ERROR page

放肆的年华 提交于 2020-01-03 06:04:07

问题


i have created a jsp contains

<% 
  int i=10;
  if(i==10)
  throw new ArithmeticException("ItsMyGenExcepetion"); 
%>

i have made entry in web.xml

<error-page>
<exception-type>java.lang.ArithmeticException</exception-type>
<location>/errordisplay.jsp</location>
</error-page>

i have my errordisply.jsp contains

<%@ page isErrorPage="true" %>

in body

The page contain error <%= exception %>

but its not showing the error page....


回答1:


Try adding:

<%@ page errorPage="/errordisplay.jsp" %>

to the JSP that is throwing the exception.




回答2:


here i got my quetions solution but not the answer

when i use Eclipse's (SDK 3.2) web browser...

the page is showing

The page cannot be displayed There is a problem with the page you are trying to reach and it cannot be displayed.


Please try the following:

Open the localhost:8080 home page, and then look for links to the information you want. Click the Refresh button, or try again later.

Click Search to look for information on the Internet. You can also see a list of related sites.

HTTP 500 - Internal server error Internet Explorer

where as,when i use mozilla firefox for the same url,it works.

but why???



来源:https://stackoverflow.com/questions/1470750/j2eeerror-in-displaying-error-page

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!