?? transferactionfrom.java
字號:
package com.bluedot.bank.framework.web.actionform;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
public class TransferActionFrom extends ActionForm {
private static final long serialVersionUID = 1L;
private String accountId1;
private String accountId2;
private String action2;
public String getAccountId1() {
return accountId1;
}
public void setAccountId1(String accountId1) {
this.accountId1 = accountId1;
}
public String getAccountId2() {
return accountId2;
}
public void setAccountId2(String accountId2) {
this.accountId2 = accountId2;
}
public String getAction2() {
return action2;
}
public void setAction2(String action2) {
this.action2 = action2;
}
@Override
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
if(this.action2.length()>11||!this.action2.matches("[0-9]{1,10}")){
errors.add("action2", new ActionMessage("error.countLine2.rep"));
return errors;
}
if(this.accountId1==null||this.accountId1.trim().isEmpty()){
errors.add("accountId", new ActionMessage("error.accountId.re"));
}
if(this.accountId2==null||this.accountId2.trim().isEmpty()){
errors.add("accountId2", new ActionMessage("error.accountId.re"));
}
if(this.action2==null||this.action2.trim().isEmpty()||Integer.valueOf(this.action2)<=0){
errors.add("action2", new ActionMessage("error.countLine2.rep"));
}
if(this.accountId1.equals(this.accountId2)){
errors.add("accountId2", new ActionMessage("error.accountId"));
}
return errors;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -