📄 replytopicform.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;
public class ReplyTopicForm extends ActionForm {
private Integer topicId;
private Integer authorId;
private String author;
private String text;
public Integer getTopicId() {
return topicId;
}
public void setTopicId(Integer topicId) {
this.topicId = topicId;
}
public Integer getAuthorId() {
return authorId;
}
public void setAuthorId(Integer authorId) {
this.authorId = authorId;
}
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;
}
@Override
public void reset(ActionMapping mapping, HttpServletRequest request) {
this.text = "";
}
@Override
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
System.out.println(authorId);
System.out.println(author);
System.out.println(text);
System.out.println(topicId);
ActionErrors errors = new ActionErrors();
if ("".equals(this.text)
|| (this.authorId != null && this.authorId.intValue() < 1)
|| (this.author != null && "".equals(this.author.trim()))
|| (this.topicId != null && this.topicId.intValue() < 1)) {
errors.add("", new ActionError("forum.topic.reply.text.requried"));
}
return errors;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -