编写一个封装用户信息的JavaBean对象,通过操作JavaBean的动作标识,输出用户的注册信息。...

package come.hanqi.test;

public class YhBean {
    private String username;
    private String password;
    private String email;
    private String dizhi;
    public String getUsername() {
        return username;
    }
    public void setUsername(String username) {
        this.username = username;
    }
    public String getPassword() {
        return password;
    }
    public void setPassword(String password) {
        this.password = password;
    }
    public String getEmail() {
        return email;
    }
    public void setEmail(String email) {
        this.email = email;
    }
    public String getDizhi() {
        return dizhi;
    }
    public void setDizhi(String dizhi) {
        this.dizhi = dizhi;
    }
    

}
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>注册</title>
</head>
<body>
<form action="testYhBean2.jsp" method="post">
<table align="center" width="400" height="200" border="1"cellspacing="0" cellpadding="0">
<tr><td align="center" height="50" colspan="2">请输入注册信息</td></tr>
<tr>
<td>账号:</td>
<td><input type="text" name="username"></td>
</tr>
<tr>
<td>密码:</td>
<td><input type="password" name="password"></td>
</tr>
<tr>
<td>邮箱:</td>
<td><input type="text" name="email"></td>
</tr>
<tr>
<td>地址:</td>
<td><input type="text" name="dizhi"></td>
</tr>
<tr>
<td align="center" colspan="2"><input type="submit"   value="提交"></td>

</tr>
</table>
</form>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>注册显示</title>

</head>
<body>
<%request.setCharacterEncoding("UTF-8");%>
<jsp:useBean id="person" class="come.hanqi.test.YhBean">
<jsp:setProperty name="person" property="*"/></jsp:useBean>
您的注册信息为:<br>
账号:<jsp:getProperty property="username" name="person"/><br>
密码:<jsp:getProperty property="password" name="person"/><br>
邮箱:<jsp:getProperty property="email" name="person"/><br>
地址:<jsp:getProperty property="dizhi" name="person"/><br>
</body>
</html>

转载于:https://www.cnblogs.com/jskbk/p/5627430.html

  • 2
    点赞
  • 24
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值