`

配置错误页

    博客分类:
  • JSP
阅读更多

在web开发中往往会遇到服务器错误或路径请求有误这时候会出现很不友好的页面要想出现自己设置的提示则

在web.xml文件下配置:

  <!-- 页面不存在  -->  
  <error-page>
            <error-code>404</error-code> 
            <location>/pagenotfound.html</location> 
 </error-page>

<error-page>
            <error-code>505</error-code> 
            <location>/requesterror.html</location> 
 </error-page>
  <!-- 错误页面 --> 
 <error-page>  
          <exception-type>java.lang.Exception</exception-type>   
          <location>/error.html</location>  
</error-page>
 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics