【Java开源代码栏目提醒】:网学会员鉴于大家对Java开源代码十分关注,论文会员在此为大家搜集整理了“TopicForm.java”一文,供大家参考学习
/*
* TopicForm.java
*
* Created on 2006年6月14日, 上午3:27
*/
package form.
bbs;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
/**
*
* @author Administrator
* @version
*/
public class TopicForm extends org.apache.struts.action.ActionForm {
private String name;
private String remarks;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getRemarks() {
return remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
if (getName() == null || getName().equals("")) {
errors.add("name", new ActionMessage("errors.topic.name.required"));
}
if (getRemarks() == null) {
errors.add("remarks", new ActionMessage("errors.topic.remarks.required"));
}
return errors;
}
}