body 태그 안에 int su = 10 / 0; 을 주고 실행할 시 아래와 같은 error 홈페이지가 뜸!

error 발생 시 홈페이지 화면에 글을 출력하는 틀을 만들어보자!
web.xml 생성!

=============================코드=============================
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd" version="4.0">
<display-name>02_JSP</display-name>
<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>
<!-- 에러 페이지 설정 -->
<error-page>
<error-code>500</error-code>
<location>/error/error_500.jsp</location>
</error-page>
</web-app>
error 명인 folder 생성 -> error_500.jsp jsp파일 생성

=============================코드=============================
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<h2>
죄송함다! 서비스 실행 도중 오류가 발생했습니다
잠시 후 다시 시도하시기 바랍니다.
</h2>
</body>
</html>
다시 Ex05.jsp 파일로 가보자!
=============================코드=============================
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
int su = 10 / 0;
%>
</body>
</html>

error 404도 만들어보자!
web.xml
=============================코드=============================
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd" version="4.0">
<display-name>02_JSP</display-name>
<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>
<!-- 에러 페이지 설정 -->
<error-page>
<error-code>500</error-code>
<location>/error/error_500.jsp</location>
</error-page>
<error-page>
<error-code>404</error-code>
<location>/error/error_404.jsp</location>
</error-page>
</web-app>
error_404.jsp 파일 생성!
=============================코드=============================
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<h2>요청하신 페이지는 존재하지 않는 페이지입니다...</h2>
</body>
</html>