J2ee各种异常页面和首页地址统一指向
J2ee各种错误页面和首页地址统一指向
需求:
系统上线之后不希望用户看到各种错误信息以及通过域名访问直接定位到首页
实现:
web.xml中配置各种error和welcome:
<error-page> <error-code>404</error-code> <location>/usr/tologin</location> </error-page> <error-page> <error-code>500</error-code> <location>/usr/tologin</location> </error-page> <welcome-file-list> <welcome-file>/usr/tologin</welcome-file> </welcome-file-list>