schoolshiptopicform.java

来自「java web开发技术方案宝典」· Java 代码 · 共 81 行

JAVA
81
字号
package com.form;

import java.util.HashSet;
import java.util.Set;

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 org.apache.struts.action.ActionMessage;

public class SchoolShipTopicForm extends ActionForm {
	private Integer id;

	private String author;

	private String content;

	private String leaveTime;

	private Set tbSchoolShipReplies = new HashSet(0);

	public SchoolShipTopicForm() {
	}

	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getAuthor() {
		return this.author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public String getContent() {
		return this.content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getLeaveTime() {
		return this.leaveTime;
	}

	public void setLeaveTime(String leaveTime) {
		this.leaveTime = leaveTime;
	}

	public Set getTbSchoolShipReplies() {
		return this.tbSchoolShipReplies;
	}

	public void setTbSchoolShipReplies(Set tbSchoolShipReplies) {
		this.tbSchoolShipReplies = tbSchoolShipReplies;
	}

	public ActionErrors validate(ActionMapping mapping,
			HttpServletRequest request) {
		ActionErrors actionErrors = new ActionErrors();
		String method = request.getParameter("method");
		if (method.equals("addSchoolShipTopic")) {
			if (content == null || content.equals("")) {
				actionErrors.add("emptyContent", new ActionMessage(
						"emptyContent"));
			}
		}
		return actionErrors;
	}

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?