两种方式解决异常跳转指定页面
web.xml文件:
<error-page>
<error-code>500</error-code>
<location>/exception500.jsp</location>
</error-page>
添加注解
@ExceptionHandler
@ExceptionHandler(Exception.class)
public String ex(){
System.out.println("exception......");
return "exception";
}