目录

jsp page include指令实例

2019年01月17日 20:24 | 1800次浏览

实训内容和要求

编写三个 JSP 页面:first.jsp、second.jsp 和 third.jsp。另外,要求用“记事本”编写一个 hello.txt 文件。

hello.txt 中的每行都有若干个英文单词,这些单词之间用空格分隔,每行之间用 <br> 分隔,如下所示:

package apple void back public
<br>
private throw class hello welcome


实训步骤

(1) first.jsp 的具体要求。

first.jsp 使用 page 指令设置 contentType 属性的值为 text/plain,使用 include 指令静态插入 hello.txt 文件。first.jsp 的代码如下:

<%@ page contentType="text/plain" %>
<html>
<body>
<font Size=4 color=blue>
<%@ include file="hello.txt" %>
</font>
</body>
</html>


(2) second.jsp 的具体要求。

second.jsp 使用 page 指令设置 contentType 属性的值为 application/vn.ms-powerpoint,使用 include 指令静态插入 hello.txt 文件。second.jsp 的代码如下:

<%@ page contentType="application/vnd.ms-powerpoint" %>
<html>
<body>
<font Size=2 color=blue>
<%@ include file="hello.txt" %>
</font>
</body>
</html>


(3) third.jsp 的具体要求。

third.jsp 使用 page 指令设置 contentType 属性的值为 application/msword,使用 include 指令静态插入 hello.txt 文件。third.jsp 的代码如下:

<%@ page contentType="application/msword" %>
<html>
<body>
<font Size=4 color=blue>
<%@ include file="hello.txt" %>
</font>
</body>
</html>



小说《我是全球混乱的源头》

感觉本站内容不错,读后有收获?小额赞助,鼓励网站分享出更好的教程


上一篇:jsp include指令详解 下一篇:jsp动作标签
^