📄 editnewssubmitform.java
字号:
/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package com.hao2007.struts.form;
import java.util.Date;
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;
/**
* MyEclipse Struts Creation date: 08-29-2007
*
* XDoclet definition:
*
* @struts.form name="editNewsSubmitForm"
*/
public class EditNewsSubmitForm extends ActionForm {
/*
* Generated Methods
*/
private int id;
private String title;
private String key_words;
private int sort_id;
private String sort_path;
private String content;
private Date add_time;
private String source;
private String author;
public Date getAdd_time() {
return add_time;
}
public void setAdd_time(Date add_time) {
this.add_time = add_time;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getKey_words() {
return key_words;
}
public void setKey_words(String key_words) {
this.key_words = key_words;
}
public int getSort_id() {
return sort_id;
}
public void setSort_id(int sort_id) {
this.sort_id = sort_id;
}
public String getSort_path() {
return sort_path;
}
public void setSort_path(String sort_path) {
this.sort_path = sort_path;
}
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
/**
* Method validate
*
* @param mapping
* @param request
* @return ActionErrors
*/
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
// TODO Auto-generated method stub
ActionErrors errors = new ActionErrors();
if (getTitle().trim() == null || getTitle().trim().length() < 2) {
errors.add("add.news.title.error", new ActionMessage(
"add.news.title.errors"));
}
if (getKey_words().trim() == null || getKey_words().trim().length() < 2) {
errors.add("add.news.key_words.error", new ActionMessage(
"add.news.key_words.errors"));
}
if (getContent().trim() == null || getContent().trim().length() < 10) {
errors.add("add.news.content.error", new ActionMessage(
"add.news.content.errors"));
}
if (getSource().trim() == null || getSource().trim().length() < 2) {
errors.add("add.news.source.error", new ActionMessage(
"add.news.source.errors"));
}
if (getAuthor().trim() == null || getAuthor().trim().length() < 2) {
errors.add("add.news.author.error", new ActionMessage(
"add.news.author.errors"));
}
return errors;
}
/**
* Method reset
*
* @param mapping
* @param request
*/
public void reset(ActionMapping mapping, HttpServletRequest request) {
// TODO Auto-generated method stub
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -