📄 newnoticeform.java
字号:
package nm.user.form;
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;
/**
* <strong>NewNoticeForm </strong> handles the form that the user will use to
* insert a new notice into the database.
*/
public final class NewNoticeForm extends ActionForm {
/**
*
*/
private static final long serialVersionUID = 1L;
private String title = null;
private String content = null;
/**
* @return Returns the content.
*/
public String getContent() {
return content;
}
/**
* @param content
* The content to set.
*/
public void setContent(String content) {
this.content = content;
}
/**
* @return Returns the title.
*/
public String getTitle() {
return title;
}
/**
* @param title
* The title to set.
*/
public void setTitle(String title) {
this.title = title;
}
public void reset(ActionMapping mapping, HttpServletRequest request) {
title = null;
content = null;
}
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
if (((title == null) || (title.length() < 1)))
errors.add("titleRequired", new ActionMessage(
"notice.insert.title.required"));
return errors;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -