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

<%@page contentType="text/html;charset=gb2312" pageEncoding="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"><form name="form1" method="post" action="mypage05.jsp">

您的名字：

<input name="myname" type="text" id="myname">

<input type="submit" name="Submit" value="提交">

</form>

<div align="center">

<%

String myname="";

request.setCharacterEncoding("GB2312");

myname = request.getParameter("myname");

if(myname != null)

{

out.println("您的名字是：" + myname);

}

out.println( "<BR>你计算机的 IP 地址是： " );

out.println( request.getRemoteHost());

%>

</div></td>

</tr>

</table>

</body>

</html>

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

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