·进入 jsp_test 目录，在该目录建立 mypage06.jsp。

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

<%@ page import="java.util.*" %>

<html>

<head>

<title> 学习 JSP </title>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312"><style type="text/css">

<!--

body {

background-color: #CCCCCC;

}

-->

</style></head>

<body>

<table width="474" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#336699">

<tr>

<td width="470" bgcolor="#FFFFFF"><img src="images/rabbit.gif" width="468" height="60"></td>

</tr>

<tr>

<td height="144" bgcolor="#FFFFFF"><div align="center">

<TABLE BORDER=2>

<%

for ( int i = 0; i < 3; i++ ) {

%>

<TR>

<TD>数字</TD>

<TD><%= i+1 %></TD>

</TR>

<%

}

%>

</TABLE>

<%

boolean hello = true;

if ( hello ) {

%>

<P>Hello, world

<%

} else {

%>

<P>Goodbye, world

<%

}

%>

</div></td>

</tr>

</table>

</body>

</html>

·在浏览器上打开下面连接

http://localhost:8080/jsp_test/mypage06.jsp