404/500/错误/异常/默认页面配置汇总
2014-11-23 23:20
746 查看
404/500/错误/异常/默认页面配置汇总.
1、通常的web.xml配置:
<!-- 错误页面: -->
<error-page>
<error-code>404</error-code>
<location>/404.html</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/500.html</location>
</error-page>
<error-page>
<exception-type>javax.servle.ServletException</exception-type>
<location>/error.html</location>
</error-page>
<error-page>
<exception-type>java.lang.NullPointerException</exception-type>
<location>/error.html</location>
</error-page>
<!--默认欢迎页面: -->
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
2、Struts2的struts.xml配置 - 错误页面:
<default-action-ref name="error"></default-action-ref>
<action name="error">
<result>/error.jsp</result>
</action>
1、通常的web.xml配置:
<!-- 错误页面: -->
<error-page>
<error-code>404</error-code>
<location>/404.html</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/500.html</location>
</error-page>
<error-page>
<exception-type>javax.servle.ServletException</exception-type>
<location>/error.html</location>
</error-page>
<error-page>
<exception-type>java.lang.NullPointerException</exception-type>
<location>/error.html</location>
</error-page>
<!--默认欢迎页面: -->
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
2、Struts2的struts.xml配置 - 错误页面:
<default-action-ref name="error"></default-action-ref>
<action name="error">
<result>/error.jsp</result>
</action>
相关文章推荐
- 关于tomcat服务器部署,页面报404/500错误,myeclipse异常关闭 导致tomcat 6.0 无法重启 的问题
- spring mvc配置自定义错误404,500页面
- django的403/404/500错误自定义页面的配置
- Tomcat配置400/404/500自定义错误页面
- 配置web404,500等异常页面
- jsp错误页面404、500等异常捕获
- Nginx配置error_page 404 500等自定义的错误页面
- 配置404,错误页面异常页面及其页面打印错误代码
- 404,500等错误页面配置
- django的403/404/500错误自定义页面的配置
- 在java web中配置默认的404或其他错误页面的方式
- javaweb 配置系统错误页面404或500 等其他错误代码
- NGINX下配置404错误页面的方法分享
- Apache错误页面404、403配置教程
- NGINX 配置404错误页面转向
- NGINX 配置404错误页面转向
- 为Nginx制作404 403 500等错误页面
- 常见jsp出现的页面错误(404,500等)与捕捉办法
- web应用设置统一友好错误页面,处理404,500等错误
- 捕获页面的404,500等错误