📄 userlistaction.java
字号:
/**
* UserList.java created by feiling
*/
package com.feiling.web.user;
import java.util.List;
import com.feiling.common.tools.MethodPerformance;
import com.feiling.common.tools.Pager;
import com.feiling.service.UserService;
import com.opensymphony.xwork2.ActionContext;
/**
* @author 邓飞玲
* Sep 20, 2008
* deng819@163.com
*/
public class UserListAction extends AbstractActionSupport {
private UserService userService;
private List users;
private String curPage;
private String rows;
public void setUserService(UserService userService)
{
this.userService = userService;
}
public String execute() throws Exception
{
MethodPerformance execTime = new MethodPerformance("UserListAction#execute()");
Pager pager = new Pager();
if(curPage != null)
pager.setCurPage(Integer.parseInt(curPage));
if(rows != null && !rows.equals(""))
{
pager.setResultCount(Integer.parseInt(rows));
}else{
int count = userService.getUsersCount();
pager.setResultCount(count);
this.rows = count + "";
}
users = userService.getUsers(pager.getMark(), pager.getPageSize());
ActionContext.getContext().put("pager", pager);
execTime.printPerformance();
return SUCCESS;
}
/**
* @return the users
*/
public List getUsers() {
return users;
}
/**
* @param users the users to set
*/
public void setUsers(List users) {
this.users = users;
}
/**
* @return the curPage
*/
public String getCurPage() {
return curPage;
}
/**
* @param curPage the curPage to set
*/
public void setCurPage(String curPage) {
this.curPage = curPage;
}
/**
* @return the rows
*/
public String getRows() {
return rows;
}
/**
* @param rows the rows to set
*/
public void setRows(String rows) {
this.rows = rows;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -