保存前的验证信息。
/*******************************************************************************
*
* @author Administrator 验证单位是否有下属单位
*/
public class OrgValidator implements Validator {
public String validate(ActionContext ac, String value, String expression,
int rowIndex) {
// TODO Auto-generated method stub
// String lower = "";
try {
DB db = DBFactory.getDB();
MapList orglist = db
.query("select lowerid from aorglevel where upperid ='" + value
+ "'");
if (Checker.isEmpty(orglist)) {
return null;
}
else {
return "本单位有下属单位,请选择下属单位";
}
}catch (Exception e){
System.out.println("error validate");
return "error";
}
}
public String validate(ActionContext arg0, String arg1, String arg2,
String arg3) {
// TODO Auto-generated method stub
return null;
}
}
阅读(862) | 评论(0) | 转发(0) |