user.java
来自「本书由浅入深、循序渐进地介绍了MVC的体系结构和如何构建一个基于MVC的Web框」· Java 代码 · 共 64 行
JAVA
64 行
package com.myContent.vo;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;
import com.gd.jdbc.impl.GdDbCommon;
public class User {
public User() {
}
//定义变量
private int id = 0;
private String username = "";
private String password = "";
private String passwordb = "";
public void setUsername(String username) {
this.username = username;
}
public String getUsername() {
return this.username;
}
public void setPassword(String password) {
this.password = password;
}
public String getPassword() {
return this.password;
}
public void setPasswordb(String passwordb) {
this.passwordb = passwordb;
}
public String getPasswordb() {
return this.passwordb;
}
public String validate() {
String msg = "";
if (!this.password.equals(this.passwordb) && !"".equals(this.passwordb)) {
msg = "2次输入的密码必须相等";
}
if (this.password.length() < 3) {
msg = "密码长度不能小于3";
}
if ("".equals(this.username) || "".equals(this.password)) {
msg = "用户名和密码不能为空";
}
return msg;
}
/**
* @return the id
*/
public int getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(int id) {
this.id = id;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?