Exception handling a SpringMVC

Now when simulating a login, if the user name or password when an exception occurs, it jumps to a custom error page to go

error.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
错误信息:${e.message}
</body>
</html>

  

 

operation result:

 

 

 

Guess you like

Origin www.cnblogs.com/dongyaotou/p/12233270.html