insertbooksform.java
来自「struts实现的图书管理系统,借书」· Java 代码 · 共 70 行
JAVA
70 行
package com.gton.formbean.admin;
import javax.servlet.http.*;
import org.apache.struts.action.*;
public class InsertBooksForm extends ActionForm {
private int bookType_ID;
private String books_Company;
private int books_Count;
private String books_Name; private static final long serialVersionUID = 1L;
public int getBookType_ID() {
return bookType_ID;
}
public void setBookType_ID(int bookType_ID) {
this.bookType_ID = bookType_ID;
}
public void setBooks_Name(String books_Name) {
this.books_Name = books_Name;
}
public void setBooks_Count(int books_Count) {
this.books_Count = books_Count;
}
public void setBooks_Company(String books_Company) {
this.books_Company = books_Company;
}
public String getBooks_Company() {
return books_Company;
}
public int getBooks_Count() {
return books_Count;
}
public String getBooks_Name() {
return books_Name;
}
public ActionErrors validate(ActionMapping actionMapping,
HttpServletRequest httpServletRequest)
{
ActionErrors err = new ActionErrors();
if (this.getBooks_Company() == null ||this.getBooks_Company().length()<1) {
err.add("companyerr", new ActionMessage("err.user.login.companynullerr"));
}
if (this.getBooks_Name() == null||this.getBooks_Name().length()<1) {
err.add("booknameerr", new ActionMessage("err.user.login.booknamenullerr"));
}
if (this.getBooks_Count()<1) {
err.add("bookcounterr", new ActionMessage("err.user.login.bookcountnullerr"));
}
if (this.getBookType_ID()==0) {
err.add("bookiderr", new ActionMessage("err.user.login.bookidnullerr"));
}
return err;
}
public void reset(ActionMapping actionMapping,
HttpServletRequest servletRequest) {
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?