📄 inputautoform.java
字号:
/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package chenxin.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: 07-14-2008
*
* XDoclet definition:
* @struts.form name="inputAutoForm"
*/
public class InputAutoForm extends ActionForm {
/*
* Generated fields
*/
/** no property */
private String id;
private String no;
/** price property */
private String price;
/** category property */
private String category;
/** model property */
private String model;
private String judge;
/*
* 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 (model == null || model.length() == 0) {
errors.add("model_error",new ActionMessage("model_error"));
}
if (no == null || no.length() != 7) {
errors.add("no_error",new ActionMessage("no_error"));
}
try {
if (!(Double.parseDouble(price)>=100&&Double.parseDouble(price)<=2000)) {
errors.add("price1",new ActionMessage("price1"));
}
} catch (NumberFormatException e) {
// TODO Auto-generated catch block
System.out.println(e);
errors.add("price1",new ActionMessage("price1"));
return errors;
}
return errors;
}
/**
* Method reset
* @param mapping
* @param request
*/
public void reset(ActionMapping mapping, HttpServletRequest request) {
// TODO Auto-generated method stub
}
/**
* Returns the no.
* @return String
*/
public String getNo() {
return no;
}
/**
* Set the no.
* @param no The no to set
*/
public void setNo(String no) {
this.no = no;
}
/**
* Returns the price.
* @return String
*/
public String getPrice() {
return price;
}
/**
* Set the price.
* @param price The price to set
*/
public void setPrice(String price) {
this.price = price;
}
/**
* Returns the category.
* @return String
*/
public String getCategory() {
return category;
}
/**
* Set the category.
* @param category The category to set
*/
public void setCategory(String category) {
this.category = category;
}
/**
* Returns the model.
* @return String
*/
public String getModel() {
return model;
}
/**
* Set the model.
* @param model The model to set
*/
public void setModel(String model) {
this.model = model;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getJudge() {
return judge;
}
public void setJudge(String judge) {
this.judge = judge;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -