JSP include 指令

时间:2023-12-29 10:40:14

1. 创建test5.jsp test5_1.jsp test5_2.jsp

test5_1.jsp

<%@ page import="java.util.*" %>
<%=(new java.util.Date()).toLocaleString() %>

 

test5_2.jsp

<div>hello world</div>

  

test5.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>
<p>test5</p>
<%@ include file="test5_2.jsp" %> <%@ include file="test5_1.jsp" %>
</body>
</html>