JSP页面的静态包含和动态包含使用方法
时间:2018/5/9 21:58:33阅读:
JSP中有两种包含:静态包含:<%@include file="被包含页面"%>和动态包含:<jsp:include page="被包含页面"flush="true">。下面以一个例子来说明如何使用包含。实例:项目文件树:header.jsp文件中内容:<html><head&…
JSP中有两种包含:静态包含:<%@include file="被包含页面"%>和动态包含:<jsp:include page="被包含页面"flush="true">。下面以一个例子来说明如何使用包含。
实例:
项目文件树:
header.jsp文件中内容:
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=GB18030"> <title>Insert title here</title> </head> <body> <h1>This is header</</h1>