📄 userform.java
字号:
// ----------------------------------------------------------
// $Id: $
// Copyright (c) SHSAFE 2005-2006. All Rights Reserved.
// ----------------------------------------------------------
package example.user;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.collections.Factory;
import org.apache.commons.collections.ListUtils;
import org.apache.commons.collections.list.LazyList;
import org.apache.struts.action.ActionMapping;
import com.shsafe.common.struts.action.BaseActionForm;
import example.common.dto.UserDTO;
/**
* @author Michael J Chane
* @version $Revision: $ $Date: $
*/
public class UserForm extends BaseActionForm implements Factory {
/**
* The serialVersionUID
*/
private static final long serialVersionUID = 2105774027247378580L;
/**
* Condition data
*/
private UserDTO condition;
/**
* List data;
*/
private List listData;
/**
*
* Creates a new <code>UserForm</code> object.
*
*/
public UserForm() {
condition = new UserDTO();
pageInfo.setPageSize(5);
}
/**
* @see org.apache.struts.validator.ValidatorForm#reset(org.apache.struts.action.ActionMapping, javax.servlet.http.HttpServletRequest)
* @param mapping
* @param request
*/
@Override
public void reset(ActionMapping mapping, HttpServletRequest request) {
// TODO Auto-generated method stub
super.reset(mapping, request);
}
/**
* Retrieves the condition.
*
* @return Returns the condition.
*/
public UserDTO getCondition() {
return condition;
}
/**
* Sets the condition to the given value.
*
* @param condition
* The condition to set.
*/
public void setCondition(UserDTO condition) {
this.condition = condition;
}
/**
* Retrieves the listData.
*
* @return Returns the listData.
*/
public List getListData() {
return listData;
}
/**
* Sets the listData to the given value.
*
* @param listData
* The listData to set.
*/
public void setListData(List listData) {
if (listData instanceof LazyList) {
this.listData = listData;
} else {
listData = (listData == null ? new ArrayList() : listData);
this.listData = ListUtils.lazyList(listData, this);
}
}
/**
* @see org.apache.commons.collections.Factory#create()
* @return UserDTO
*/
public Object create() {
return new UserDTO();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -