【Java开源代码栏目提醒】:网学会员Java开源代码为您提供addArraFormBean.java参考,解决您在addArraFormBean.java学习中工作中的难题,参考学习。
package formBean;
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;
/**
* @author dengziyun
* 封装输入信息表单数据的FormBean
*/
public class addArraFormBean extends ActionForm{
String thingId;//事务ID号
String oaUserId;//用户ID号
/**
* 重置所有属性的值
*/
public void reset(ActionMapping arg0, HttpServletRequest request) {
thingId=null;
oaUserId=null;
}
/**
* 验证表单中的数据
*/
public ActionErrors validate(ActionMapping arg0, HttpServletRequest request) {
ActionErrors errors=new ActionErrors();
//------事务Id号非空校验------
if(thingId==null||thingId.trim().length()<1)
errors.add("thingIdIsNull",new ActionMessage("thingIdIsNull"));
//------用户Id号非空校验------
if(oaUserId==null||oaUserId.trim().length()<1)
errors.add("oaUserIdIsNull",new ActionMessage("oaUserIdIsNull"));
return errors;
}
public String getOaUserId() {
return oaUserId;
}
public void setOaUserId(String oaUserId) {
this.oaUserId = oaUserId;
}
public String getThingId() {
return thingId;
}
public void setThingId(String thingId) {
this.thingId = thingId;
}
}
上一篇:
addArraAction.java
下一篇:
那些令你为之触动的好句子,感慨万分