實訓內容和要求
編寫三個 JSP 頁面:first.jsp、second.jsp 和 third.jsp。另外,要求用“記事本”編寫一個 hello.txt 文件。
hello.txt 中的每行都有若干個英文單詞,這些單詞之間用空格分隔,每行之間用
分隔,如下所示:
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>