【Java开源代码栏目提醒】:网学会员,鉴于大家对Java开源代码十分关注,论文会员在此为大家搜集整理了“addThingFormBean.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 addThingFormBean extends ActionForm{
String thingTitle;//审批事务标题
String thingContent;//审批事务内容
/**
* 重置所有属性的值
*/
public void reset(ActionMapping arg0, HttpServletRequest request) {
thingTitle=null;
thingTitle=null;
}
/**
* 验证表单中的数据
*/
public ActionErrors validate(ActionMapping arg0, HttpServletRequest request) {
ActionErrors errors=new ActionErrors();
//------信息标题非空校验------
if(thingTitle==null||thingTitle.trim().length()<1)
errors.add("thingTitleIsNull",new ActionMessage("thingTitleIsNull"));
//------信息内容非空校验------
if(thingContent==null||thingContent.trim().length()<1)
errors.add("thingContentIsNull",new ActionMessage("thingContentIsNull"));
return errors;
}
public String getThingContent() {
return thingContent;
}
public void setThingContent(String thingContent) {
this.thingContent = thingContent;
}
public String getThingTitle() {
return thingTitle;
}
public void setThingTitle(String thingTitle) {
this.thingTitle = thingTitle;
}
}