public class UserInfo extends java.lang.Object implements FCloneable, java.io.Serializable
构造器和说明 |
---|
UserInfo() |
UserInfo(javax.servlet.http.HttpServletRequest req)
从HTTP请求中分析cookie获取用户信息
|
UserInfo(long id,
java.lang.String username,
java.lang.String password) |
UserInfo(java.lang.String username,
java.lang.String password,
boolean remember)
根据指定的用户名密码信息构造用户信息
|
限定符和类型 | 方法和说明 |
---|---|
boolean |
analysisCookies(javax.servlet.http.HttpServletRequest req)
从cookie中取用户名密码
|
java.lang.Object |
clone() |
void |
dealBrowserCookies(javax.servlet.http.HttpServletResponse res) |
void |
dealBrowserCookies(javax.servlet.http.HttpServletResponse res,
javax.servlet.http.HttpSession httpSession)
保存cookie
|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getDesc()
获取描述信息
|
long |
getId()
获取用户ID
|
java.lang.String |
getPassword()
获取用户密码
|
java.lang.String |
getUsername()
获取用户名
|
int |
hashCode()
对象的hash值
|
void |
removeCookies(javax.servlet.http.HttpServletResponse res)
移除cookie
|
void |
setDesc(java.lang.String desc)
设置用户描述信息
|
void |
setId(long id)
设置用户ID
|
void |
setPassword(java.lang.String password)
设置用户密码
|
void |
setRemember(boolean remember)
设置是否保持登陆
|
void |
setUsername(java.lang.String username)
设置用户名
|
public UserInfo()
public UserInfo(javax.servlet.http.HttpServletRequest req) throws java.lang.Exception
req
- HTTP请求java.lang.Exception
public UserInfo(java.lang.String username, java.lang.String password, boolean remember)
username
- 用户名password
- 密码remember
- 是否记住密码public UserInfo(long id, java.lang.String username, java.lang.String password)
public long getId()
public void setId(long id)
id
- 用户IDpublic java.lang.String getUsername()
public void setUsername(java.lang.String username)
username
- 用户名public java.lang.String getDesc()
public void setDesc(java.lang.String desc)
desc
- 用户描述信息public java.lang.String getPassword()
public void setPassword(java.lang.String password)
password
- 用户密码public void setRemember(boolean remember)
remember
- true:保持登陆, false:不保持登录public boolean analysisCookies(javax.servlet.http.HttpServletRequest req) throws java.lang.Exception
req
- Servlet请求java.lang.Exception
- 异常public void dealBrowserCookies(javax.servlet.http.HttpServletResponse res) throws java.lang.Exception
java.lang.Exception
public void dealBrowserCookies(javax.servlet.http.HttpServletResponse res, javax.servlet.http.HttpSession httpSession) throws java.lang.Exception
res
- Servlet响应java.lang.Exception
- 异常public void removeCookies(javax.servlet.http.HttpServletResponse res)
res
- Servlet响应public int hashCode()
hashCode
在类中 java.lang.Object
public boolean equals(java.lang.Object obj)
equals
在类中 java.lang.Object
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
在接口中 FCloneable
clone
在类中 java.lang.Object
java.lang.CloneNotSupportedException
- 如果克隆失败则抛出此异常