jsp:include
jsp:include要编译多个个文件,如果用include指令可能会出错, 因为要合成一个文件,为静态编译,比如如果charset不同就出错
index.jsp,
Java代码
<%@ page contentType ="text/html;charset=gb2312" %>
<!-- -->
<!-- jsp:include page = "top.jsp" /-->
<%@ include file = "top.jsp" %>
<html>
<head>
</head>
<body>
This is my JSP page. <br>
</body>
</html>
top.jsp
Java代码
<%@ page contentType ="text/html;charset=gb2312" %>
<html>
<head>
</head>
<body>
This is top JSP page. <br>
</body>
</html>
用include动作指令效果相同