?? addquoteform.java
字號:
/**
* 作者: 佟勁緯 創建日期: 2006-2-1
*
* QQ: 532443423 Email: TJW_7@163.com
*/
package com.tjw.guestbook.form;
import javax.servlet.http.*;
import org.apache.struts.action.*;
/**
*
*/
public class AddQuoteForm extends ActionForm {
private String id = null;
private String content = null;
public void setId(String id) {
this.id = id;
}
public String getId() {
return this.id;
}
public void setContent(String content) {
this.content = content;
}
public String getContent() {
return this.content;
}
public void reset(ActionMapping mapping, HttpServletRequest request) {
id = null;
content = null;
}
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
if (id == null || id.length() < 1) {
errors.add("idError", new ActionMessage("error.id"));
}
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 + -