JSP include 指令

Posted work hard work smart

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了JSP include 指令相关的知识,希望对你有一定的参考价值。

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>

  

 

以上是关于JSP include 指令的主要内容,如果未能解决你的问题,请参考以下文章

jsp七大动作指令

JSP的指令inclue和动作include的区别

include指令和include动作的区别

include指令与动作的区别

JSP学习笔记:JSP语法和指令

include指令和动作的区别