输出注册信息javabean
生活随笔
收集整理的這篇文章主要介紹了
输出注册信息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
總結
以上是生活随笔為你收集整理的输出注册信息javabean的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 复合、源文件组织
- 下一篇: 使用TortoiseSVN新建及合并分支