📄 articleform.java
字号:
/*
* ArticleInsertForm.java
*
* Created on 2006年6月14日, 上午2:51
*/
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 ArticleForm extends org.apache.struts.action.ActionForm {
private String name;
private String content;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
if (getName() == null || getName().equals("")) {
errors.add("name", new ActionMessage("errors.article.name.required"));
}
if (getContent() == null || getContent().equals("")) {
errors.add("content", new ActionMessage("errors.article.content.required"));
}
return errors;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -