📄 loginactionform.java
字号:
package com.laoer.bbscs.bbs.actionform;
import org.apache.struts.action.*;
import javax.servlet.http.*;
import com.laoer.bbscs.util.*;
public class LoginActionForm
extends ActionForm {
private String act;
private String guest;
private String passwd;
private String uname;
private String authcode;
private String cookiessave;
private String tourl;
public String getAct() {
return act;
}
public void setAct(String act) {
this.act = act;
}
public String getGuest() {
return guest;
}
public void setGuest(String guest) {
this.guest = guest;
}
public String getPasswd() {
return passwd;
}
public void setPasswd(String passwd) {
this.passwd = passwd;
}
public String getUname() {
return uname;
}
public void setUname(String uname) {
this.uname = uname;
}
public String getAuthcode() {
return authcode;
}
public void setAuthcode(String authcode) {
this.authcode = authcode;
}
public String getCookiessave() {
return cookiessave;
}
public void setCookiessave(String cookiessave) {
this.cookiessave = cookiessave;
}
public String getTourl() {
return tourl;
}
public void setTourl(String tourl) {
this.tourl = tourl;
}
public ActionErrors validate(ActionMapping actionMapping,
HttpServletRequest httpServletRequest) {
ActionErrors errors = new ActionErrors();
if (act.equals("reglogin")) {
if (guest != null && guest.length() > 0 && guest.equals("1")) {
uname = "GUEST";
passwd = "";
}
else {
if ( (!Util.isChar(uname)) || (!Util.isChar(passwd))) {
errors.add("error.user.msg1", new ActionError("error.user.msg1"));
}
}
if (cookiessave == null || cookiessave.length() == 0) {
cookiessave = "0";
}
try {
Integer.parseInt(cookiessave);
}
catch (Exception e) {
errors.add("error.parametererror",
new ActionError("error.parametererror"));
}
}
return (errors);
}
public void reset(ActionMapping actionMapping,
HttpServletRequest httpServletRequest) {
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -