📄 user.java
字号:
package com.andrew.elements;
import java.sql.Date;
import javax.servlet.http.*;
public class User {
private String username;
private String password;
private String email;
private String realname;
private int gender;
private Date birthday;
private HttpServletRequest request;
private HttpServletResponse response;
@SuppressWarnings("deprecation")
public void init() {
username = request.getParameter("username");
password = request.getParameter("password");
email = request.getParameter("email");
realname = request.getParameter("realname");
gender = Integer.parseInt(request.getParameter("gender"));
int year = Integer.parseInt(request.getParameter("year"));
int month = Integer.parseInt(request.getParameter("month"));
int day = Integer.parseInt(request.getParameter("day"));
birthday = new Date(year, month, day);
}
/**
* @return the userName
*/
public String getUserName() {
return username;
}
/**
* @param userName
* the userName to set
*/
public void setUserName(String username) {
this.username = username;
}
/**
* @return the password
*/
public String getPassword() {
return password;
}
/**
* @param password
* the password to set
*/
public void setPassword(String password) {
this.password = password;
}
/**
* @return the email
*/
public String getEmail() {
return email;
}
/**
* @param email
* the email to set
*/
public void setEmail(String email) {
this.email = email;
}
/**
* @return the realname
*/
public String getRealname() {
return realname;
}
/**
* @param realname the realname to set
*/
public void setRealname(String realname) {
this.realname = realname;
}
/**
* @return the gender
*/
public int getGender() {
return gender;
}
/**
* @param gender the gender to set
*/
public void setGender(int gender) {
this.gender = gender;
}
/**
* @return the birthday
*/
public Date getBirthday() {
return birthday;
}
/**
* @param birthday the birthday to set
*/
public void setBirthday(Date birthday) {
this.birthday = birthday;
}
/**
* @return the request
*/
public HttpServletRequest getRequest() {
return request;
}
/**
* @param request the request to set
*/
public void setRequest(HttpServletRequest request) {
this.request = request;
}
/**
* @return the response
*/
public HttpServletResponse getResponse() {
return response;
}
/**
* @param response the response to set
*/
public void setResponse(HttpServletResponse response) {
this.response = response;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -