zoukankan      html  css  js  c++  java
  • 编写一个封装用户信息的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>

  • 相关阅读:
    js+canvas画随机4位验证码
    linux 下 查看 nginx 日志中访问前10 的 ip
    mysql greatest函数
    php 如何获取 post 传递的raw 数据
    php 监控文件变化 并上传到服务器
    php 如何统计本周 本月
    Yii2.0 GridView 的强大功能
    git 导出新修改的文件
    ubuntu16.04 下安装phpMyAdmin
    如何在ubuntu16.04 上搭建 phpstorm + xdebug 调试
  • 原文地址:https://www.cnblogs.com/jskbk/p/5627430.html
Copyright © 2011-2022 走看看