📄 topicform.java
字号:
package com.elan.forum.forms;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import com.elan.forum.util.ElCheckString;
public class TopicForm extends ActionForm {
private String title;
private String author;
private String text;
private String topicType;
private Integer pieceId;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public String getTopicType() {
return topicType;
}
public void setTopicType(String actrileType) {
this.topicType = actrileType;
}
@Override
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
ActionErrors errors = null;
if (ElCheckString.isEmptyString(title)
|| ElCheckString.isEmptyString(author)
|| ElCheckString.isEmptyString(text)
|| ElCheckString.isEmptyString(topicType)
|| pieceId.intValue() < 1) {
errors = new ActionErrors();
errors.add("error", new ActionError("post.topic.validate.err"));
}
System.out.println(title);
System.out.println(author);
System.out.println(text);
System.out.println(topicType);
return errors;
}
public Integer getPieceId() {
return pieceId;
}
public void setPieceId(Integer pieceId) {
this.pieceId = pieceId;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -