Servlet3.0如何配置404,500页面
Servlet3.0如何配置404,500页面
Servlet3.0如何配置404,500页面
2015-02-03
配置web.xml就可以的,如下:
<?xml version="1.0" encoding="UTF-8"?><web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <error-page> <error-code>404</error-code> <location>/building.jsp</location></error-page> <error-page> <error-code>500</error-code> <location>/error.jsp</location></error-page> </web-app>
举报