📄 addbookform.java
字号:
/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package com.tang.admin.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;
import org.apache.struts.upload.FormFile;
/**
* MyEclipse Struts
* Creation date: 06-02-2008
*
* XDoclet definition:
* @struts.form name="newbookForm"
*/
public class AddbookForm extends ActionForm {
/*
* Generated fields
*/
/** publishhouse property */
private String publishhouse;
/** author property */
private String author;
/** price property */
private Double price;
/** bookname property */
private String bookname;
/** image property */
private String image;
/** clas property */
private String clas;
/** comment property */
private String comment;
/*
* Generated Methods
*/
/**
* Method validate
* @param mapping
* @param request
* @return ActionErrors
*/
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
// TODO Auto-generated method stub
ActionErrors errors = new ActionErrors();
if(bookname==null||bookname.equals(""))
{
ActionMessage msg1 = new ActionMessage("书名不能为空",false);
errors.add("username",msg1);
};
if(author==null||author.equals(""))
{
ActionMessage msg2 = new ActionMessage("作者不能为空",false);
errors.add("password",msg2);
}
try{
Double.parseDouble(price+"");
}catch(Exception e)
{
}finally{
//ActionMessage msg1 = new ActionMessage("请输入数字",false);
//errors.add("username",msg1);
}
if(author==null||author.equals(""))
{
ActionMessage msg2 = new ActionMessage("不能为空",false);
errors.add("password",msg2);
}
if(publishhouse==null||publishhouse.equals(""))
{
ActionMessage msg1 = new ActionMessage("不能为空",false);
errors.add("username",msg1);
};
if(clas==null||clas.equals(""))
{
ActionMessage msg2 = new ActionMessage("不能为空",false);
errors.add("password",msg2);
} if(bookname==null||bookname.equals(""))
{
ActionMessage msg1 = new ActionMessage("不能为空",false);
errors.add("username",msg1);
};
return errors;
}
/**
* Method reset
* @param mapping
* @param request
*/
public void reset(ActionMapping mapping, HttpServletRequest request) {
// TODO Auto-generated method stub
}
/**
* Returns the publishhouse.
* @return String
*/
public String getPublishhouse() {
return publishhouse;
}
/**
* Set the publishhouse.
* @param publishhouse The publishhouse to set
*/
public void setPublishhouse(String publishhouse) {
this.publishhouse = publishhouse;
}
/**
* Returns the author.
* @return String
*/
public String getAuthor() {
return author;
}
/**
* Set the author.
* @param author The author to set
*/
public void setAuthor(String author) {
this.author = author;
}
/**
* Returns the price.
* @return String
*/
public Double getPrice() {
return price;
}
/**
* Set the price.
* @param price The price to set
*/
public void setPrice(Double price) {
this.price = price;
}
/**
* Returns the bookname.
* @return String
*/
public String getBookname() {
return bookname;
}
/**
* Set the bookname.
* @param bookname The bookname to set
*/
public void setBookname(String bookname) {
this.bookname = bookname;
}
/**
* Returns the image.
* @return String
*/
public String getImage() {
return image;
}
/**
* Set the image.
* @param image The image to set
*/
public void setImage(String image) {
this.image = image;
}
/**
* Returns the clas.
* @return String
*/
public String getClas() {
return clas;
}
/**
* Set the clas.
* @param clas The clas to set
*/
public void setClas(String clas) {
this.clas = clas;
}
/**
* Returns the comment.
* @return String
*/
public String getComment() {
return comment;
}
/**
* Set the comment.
* @param comment The comment to set
*/
public void setComment(String comment) {
this.comment = comment;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -