📄 bookform.java
字号:
//Created by MyEclipse Struts// XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_4.1.0/xslt/JavaClass.xslpackage com.zyuntao.struts.form;import javax.servlet.http.HttpServletRequest;import org.apache.struts.action.ActionErrors;import org.apache.struts.action.ActionForm;import org.apache.struts.action.ActionMapping;import org.apache.struts.action.ActionMessage;/** * MyEclipse Struts * Creation date: 04-04-2006 * * XDoclet definition: * @struts.form name="BookForm" */public class BookForm extends ActionForm { // --------------------------------------------------------- Instance Variables // --------------------------------------------------------- Methods /** * Method validate * @param mapping * @param request * @return ActionErrors */ String author=null; int bookid; String bookname=null; String type=null; int borrow; String username=null; public int getBorrow() { return borrow; } public void setBorrow(int borrow) { this.borrow = borrow; } public String getAuthor() { return author; } public void setAuthor(String author) { this.author = author; } public int getBookid() { return bookid; } public void setBookid(int bookid) { this.bookid = bookid; } public String getBookname() { return bookname; } public void setBookname(String bookname) { this.bookname = bookname; } public String getType() { return type; } public void setType(String type) { this.type = type; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); if (bookname == null || bookname.length() <= 0) { errors.add("booknameError", new ActionMessage("error.bookname.null")); } if (author == null || author.length() <= 0) { errors.add("authorError", new ActionMessage( "error.author.null")); } if (type == null || type.length() <= 0) { errors.add("typeError", new ActionMessage( "error.type.null")); } return errors; }public void reset(ActionMapping mapping, HttpServletRequest request) {this.bookid=0; this.bookname=null; this.author=null; this.type=null;}}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -