一、在WebContent下创建两个页面dynamicInclude.jsp和included.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>dynamicInclude page</title>
</head>
<body>
dynamicInclude.jsp内的中文
<br>
<jsp:include page="included.jsp" flush="true" />
</body>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>include</title>
</head>
<body>
<%Thread.sleep(5000);%>
included.jsp内的中文<br />
</body>
</html>
二、启动访问
http://localhost:8080/chapter06/dynamicInclude.jsp