jsp setProperty,getProperty,useBean

来源:百度知道 编辑:UC知道 时间:2024/09/22 23:18:49
<!--register.jsp-->
<%@ page contentType="text/html;charset=gb2312"%>
<html>
<head>
<title>注册页面</title>
</head>

<body>
<form method=post action=show.jsp>
<center>
<h1 >用户注册</h1>
<table>
<tr>
<td width="65">用户名:</td>
<td width="208"><input type=text name=name></td>
</tr>
<tr>
<td>密码:</td>
<td><input type=password name=password></td>
</tr>
<tr>
<td>邮箱:</td>
<td><input type=email name=email></td>
</tr>
<tr>
<td>年龄:</td>
<td><input type=age name=age></td>
</tr>
<tr>
<td align="center"></td>
<td align="cente

show.jsp中
<%@ page contentType="text/html";charset="gb2312" %>错误,
应该是:<%@ page contentType="text/html;charset=gb2312" %>

show.jsp文件
里要加有<%@ import ="myBean1.Register"%>

用户名:<jsp:getProperty name="show" property="name" />
<br>
密码:<jsp:getProperty name="show" property="password" />
<br>
邮箱:<jsp:getProperty name="show" property="email" />
<br>
年龄:<jsp:getProperty name="show" property="age" />

这段不是这样写的