<%@ page errorPage="/library/std_errorPage.jsp"%>

解决方案 »

  1.   

    可以用
    try{
    }catch(Exception e){
                  System.out.println("");
              }finally{
                       }
    捕获错误
      

  2.   

    <%@ page errorPage="/library/std_errorPage.jsp"%>
    好像没有用吗没反应
      

  3.   

    那就只好自己判断啦1!
    先判断该文件存不存在File.exists()然后如果不存在则跳转response.Redirect("xxx.jsp")
      

  4.   

    可以在web.xml里面配找不到页面错误(error 404)等其他一些http错误的转向页面。
    也可以在web.xml里面配语法错误转向页面,这样就不用在每个jsp文件里加
    <%@ page errorPage="/library/std_errorPage.jsp"%>
    了。
      

  5.   

    例1:所有类型的Exception意外发生时转向:
      <error-page>
        <exception-type>java.lang.Exception</exception-type>
        <location>/errorpage.jsp</location>
      </error-page>例2:字符串处理意外发生时转向
      <error-page>
        <exception-type>java.lang.string</exception-type>
        <location>/errorpage2.jsp</location>
      </error-page>例3:网页找不到时转向
      <error-page>
        <error-code>404</error-code>
        <location>/errorpage3.jsp</location>
      </error-page>说明:当然所有类型错误可以转向同一个错误页面,然后在错误页面中通过exception对象显示错误。
    web.xml是在WEB-INF下的一个配置文件,详细配置参数见:
    http://edocs.bea.com/wls/docs61/webapp/web_xml.html#1017571
      

  6.   

    web.xml中 <error-page>
      <error-code>404</error-code>
       <location>/notfind.htm</location>
      </error-page>