1.Jsp包含指令:包括静态包含和动态包含。
静态包含格式:<%@include file="要包含的文件"%>静态包含 先包含,后编译处理
动态包含格式:<jsp:include page="要包含的文件">动态包含 先编译处理,后包含
<body>
<h1>静态包含</h1>
<%@include file="common/head.html"%>//common是网页共有部分(head,footer)[head.html]
[footer.jsp]
<p>content</p>
<%@include file="common/footer.jsp"%>
</body>
<body>
<h1>动态包含</h1>
<jsp:include page="common/head.html"/>
<p>content</p>
<jsp:include page="common/footer.jsp"/>
</body>
2.Jsp跳转指令
格式<jsp:forward>
<jsp:param value="" name="">
</jsp:forward>
<jsp:forward page="target.jsp"> //target.jsp是跳转后的页面
<jsp:param value="java1234" name="useName"/>
<jsp:param value="123456" name="password"/>
</jsp:forward>
target.jsp的body部分
<body>
服务器内部跳转后的页面<br/>
useName:<%= request.getParameter("useName")%><br/>
password:<%= request.getParameter("password")%><br/>
</body>