⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 additemform.java

📁 泽风留言本,非常小巧好用的东西啊.请多多照顾.
💻 JAVA
字号:
/**
 *  作者: 佟劲纬   创建日期: 2006-1-18
 *	
 *	QQ: 532443423 Email: TJW_7@163.com
 */
package com.tjw.guestbook.form;

import javax.servlet.http.*;

import org.apache.struts.action.*;

/**
 * 
 */
public final class AddItemForm extends ActionForm {

	private String caption = null;

	private String content = null;
	
	public void setCaption(String caption) {
		this.caption = caption;
	}
	
	public String getCaption() {
		return this.caption;
	}
	
	public void setContent(String content) {
		this.content = content;
	}

	public String getContent() {
		return this.content;
	}
	
	public void reset(ActionMapping mapping, HttpServletRequest request) {
		caption = null;
		content = null;
	}

	public ActionErrors validate(ActionMapping mapping,
			HttpServletRequest request) {

		ActionErrors errors = new ActionErrors();

		if (caption == null || caption.length() == 0) {
			errors.add("captionError", new ActionMessage("error.caption.null"));
		} else if (caption.length() <= 2) {
			errors.add("captionError", new ActionMessage("error.caption.small"));
		}

		if (content == null || content.length() < 1) {
			errors.add("contentError", new ActionMessage("error.content.null"));
		} else if (content.length() > 500) {
			errors.add("contentError", new ActionMessage("error.content.max"));
		}

		return errors;
	}
}

⌨️ 快捷键说明

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