输出注册信息javabean

输出用户注册信息:

package com.hanqi.test;

public class UserInfo {

    private String name;
    private String password1;
    private String password2;
    private String email;
    private String phonenum;
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getPassword1() {
        return password1;
    }
    public void setPassword1(String password1) {
        this.password1 = password1;
    }
    public String getPassword2() {
        return password2;
    }
    public void setPassword2(String password2) {
        this.password2 = password2;
    }
    public String getEmail() {
        return email;
    }
    public void setEmail(String email) {
        this.email = email;
    }
    public String getPhonenum() {
        return phonenum;
    }
    public void setPhonenum(String phonenum) {
        this.phonenum = phonenum;
    }
    
    
    
}

注册界面:

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@page import="com.hanqi.test.UserInfo"%>
<!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>Insert title here</title>
</head>
<body>

<form action="JBzhuce1.jsp" method="post">
<table width="300">
<tr>
<td width="200">请输入昵称:</td>
<td><input type="text" name="name"/></td>
</tr>
<tr>
<td width="200">请输入密码:</td>
<td><input type="password" name="password1"/></td>
</tr>
<tr>
<td width="200">请确认密码:</td>
<td><input type="password" name="password2"/></td>
</tr>
<tr>
<td width="200">请输入邮箱:</td>
<td><input type="text" name="email"/></td>
</tr>

<tr>
<td width="200">请输入手机号码:</td>
<td><input type="text" name="phonenum"/></td>
</tr>

<tr>
<td width="150"><input type="submit" value="提交"/></td>
<td><input type="reset" value="重置"/></td>
</tr>


</table>



</form>








</body>
</html>

输出信息:

<%@page import="com.hanqi.test.UserInfo"%>
<%@ 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>Insert title here</title>
</head>
<body>

<%
UserInfo ui=new UserInfo();
ui.setName(request.getParameter("name"));
ui.setPassword1(request.getParameter("password1"));
ui.setEmail(request.getParameter("email"));
ui.setPhonenum(request.getParameter("phonenum"));

out.print("姓名"+ui.getName()+"<br>密码:"+ui.getPassword1()+"<br>邮箱:"+ui.getEmail()+"<br>手机号:"+ui.getPhonenum());


%>



</body>
</html>

运行结果:

转载于:https://www.cnblogs.com/miss123/p/5631835.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值