您的位置:首页 > Web前端 > JavaScript

jsp动作元素:<jsp:include>动作元素

2016-06-07 16:12 316 查看
jsp动作元素主要包括7个:

<jsp:include>

<jsp:forward>

<jsp:param>

<jsp:plugin>

<jsp:useBean>

<jsp:setProperty>

<jsp:getProperty>

<jsp:include>动作元素:

提供了在jsp中包含页面的方式,包括静态文件和动态文件。

<jsp:include>的语法格式:

<jsp:include page="relative URL"  flush="true|false"  />

<jsp:include>中的两个属性:

page属性:指定被包含的URL地址。

flush属性:指定当缓冲区满时,是否将其清空。默认值为false

例子:

<%@ page language="java" contentType="text/html; charset=gb2312"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<title>JSP include test</title>

</head>

<body>

<jsp:include page="hello.txt"></jsp:include>

<jsp:include page="hello.jsp"></jsp:include>

<jsp:include page="1.html"></jsp:include>

</body>

</html> 

运行时会将hello.txt文件中的内容显示出来,并执行hello.jsp文件
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息