当用户访问的页面或程序不存在
应该是服务器报错
jsp里只能设当某个页发生错误时候的默认页

解决方案 »

  1.   

    web.xml文件的设置 
    默认(欢迎)文件的设置 
    在h:\tomcat4\conf\web.xml中,<welcome-file-list>与IIS中的默认文件意思相同。 
    <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> </welcome-file-list> 
    报错文件的设置 
    <error-page> <error-code>404</error-code> <location>/notFileFound.jsp</location> </error-page> <error-page> <exception-type>java.lang.NullPointerException</exception-type> <location>/null.jsp</location> </error-page> 
    如果某文件资源没有找到,服务器要报404错误,按上述配置则会调用H:\tomcat4\webapps\ROOT\notFileFound.jsp。 
    如果执行的某个JSP文件产生NullPointException ,则会调用H:\tomcat4\webapps\ROOT\null.jsp 
    典型的JSP错误页面应该这样写: 
    <%@ page isErrorPage="true"%> 出错了:(</p> 错误信息: <%= exception.getMessage() %><br> 
    Stack Trace is : <pre><font color="red"><% 
    java.io.CharArrayWriter cw = new java.io.CharArrayWriter(); 
    java.io.PrintWriter pw = new java.io.PrintWriter(cw,true); 
    Copyright &copy; Java开发者(www.ChinaJavaWorld.com), All Rights Reserved. http://www.ChinaJavaWorld.com/ 
    exception.printStackTrace(pw); 
    out.println(cw.toString()); 
    %></font></pre> 
      

  2.   

    adijava([java、MM两手抓]) 
    说的对
      

  3.   

    adijava([java、MM两手抓]):
       谢谢,如果是别的异常该如何在web.xml文件的设置