📄 searchform.java
字号:
/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package addressbook.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-15-2008
*
* XDoclet definition:
* @struts.form name="searchForm"
*/
public class SearchForm extends ActionForm {
/*
* Generated fields
*/
/** phone property */
private String phone;
/** address property */
private String address;
/** name property */
private String name;
private String email;
private String province;
/*
* Generated Methods
*/
/**
* Method validate
* @param mapping
* @param request
* @return ActionErrors
*/
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
//如果没有数据则不能全面查询,只要填一个元素就业以查询。
ActionErrors errors = new ActionErrors();
if (
((name == null) || (name.length() < 1))
&&((phone == null)|| (phone.length() < 1))
&&((address == null) || (address.length() < 1))
&&((email == null) || (email.length() < 1))
&&((province == null) || (province.length() < 1))
)
errors.add("search", new ActionMessage("error.searchcriteria.required"));
return errors;
}
/**
* Method reset
* @param mapping
* @param request
*/
public void reset(ActionMapping mapping, HttpServletRequest request) {
// TODO Auto-generated method stub
}
/**
* Returns the phone.
* @return String
*/
public String getPhone() {
return phone;
}
/**
* Set the phone.
* @param phone The phone to set
*/
public void setPhone(String phone) {
this.phone = phone;
}
/**
* Returns the address.
* @return String
*/
public String getAddress() {
return address;
}
/**
* Set the address.
* @param address The address to set
*/
public void setAddress(String address) {
this.address = address;
}
/**
* Returns the name.
* @return String
*/
public String getName() {
return name;
}
/**
* Set the name.
* @param name The name to set
*/
public void setName(String name) {
this.name = name;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -