Task_listMapper.xml文件:
**************************
com.chinaGPS.song.dao.MemberDao
public class MemberDao extends BaseMyBatisDao
/**
* 获取 下载 任务列表 分页
* @param pageRequest
* @return
*/
public Page
Page
return page;
}
***********************
package com.chinaGPS.song.service;
import java.util.List;
import com.chinaGPS.song.pojo.Task_list;
import com.chinaGPS.song.util.page.Page;
import com.chinaGPS.song.util.page.PageRequest;
public interface TaskInfoService {
public List
/**
* 获取分页下载 任务列表
* @return
*/
Page
}
}
*********************
package com.chinaGPS.song.util.page;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 分页请求信息
* 其中范型
* @author badqiu
*/
public class PageRequest
/**
* 过滤参数
*/
private T filters;
/**
* 页号码,页码从1开始
*/
private int pageNumber;
/**
* 分页大小
*/
private int pageSize;
/**
* 排序的多个列,如: username desc
*/
private String sortColumns;
public PageRequest() {
this(0,0);
}
public PageRequest(T filters) {
this(0,0,filters);
}
public PageRequest(int pageNumber, int pageSize) {
this(pageNumber,pageSize,(T)null);
}
public PageRequest(int pageNumber, int pageSize, T filters) {
this(pageNumber,pageSize,filters,null);
}
public PageRequest(int pageNumber, int pageSize,String sortColumns) {
this(pageNumber,pageSize,null,sortColumns);
}
public PageRequest(int pageNumber, int pageSize, T filters,String sortColumns) {
this.pageNumber = pageNumber;
this.pageSize = pageSize;
setFilters(filters);
setSortColumns(sortColumns);
}
public T getFilters() {
return filters;
}
public void setFilters(T filters) {
this.filters = filters;
}
public int getPageNumber() {
return pageNumber;
}
public void setPageNumber(int pageNumber) {
this.pageNumber = pageNumber;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public String getSortColumns() {
return sortColumns;
}
/**
* 排序的列,可以同时多列,使用逗号分隔,如 username desc,age asc
* @return
*/
public void setSortColumns(String sortColumns) {
this.sortColumns = sortColumns;
}
/**
* 将sortColumns进行解析以便返回SortInfo以便使用
* @return
*/
public List
return Collections.unmodifiableList(SortInfo.parseSortColumns(sortColumns));
}
}
**********************
package com.chinaGPS.song.service.impl;
import java.util.List;
import com.chinaGPS.song.dao.MemberDao;
import com.chinaGPS.song.pojo.Task_list;
import com.chinaGPS.song.service.TaskInfoService;
import com.chinaGPS.song.util.page.Page;
import com.chinaGPS.song.util.page.PageRequest;
public class TaskInfoServiceImpl implements TaskInfoService {
private MemberDao memberDao;
public MemberDao getMemberDao() {
return memberDao;
}
public void setMemberDao(MemberDao memberDao) {
this.memberDao = memberDao;
}
/* (non-Javadoc)
* @see com.chinaGPS.song.service.TaskInfoService#getAllSongList(com.chinaGPS.song.util.page.PageRequest)
*/
public Page
return memberDao.getTaskList(pageRequest);
}
}
************************
package com.chinaGPS.song.action.sysmanage;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpSession;
import org.apache.commons.lang.StringUtils;
import org.apache.struts2.ServletActionContext;
import org.displaytag.tags.TableTagParameters;
import org.displaytag.util.ParamEncoder;
import com.chinaGPS.song.action.BaseAction;
import com.chinaGPS.song.pojo.Song_info;
import com.chinaGPS.song.pojo.Task_list;
import com.chinaGPS.song.service.TaskInfoService;
import com.chinaGPS.song.util.page.Page;
import com.chinaGPS.song.util.page.PageRequest;
public class TaskListAction extends BaseAction {
private static final long serialVersionUID = -1209389500331569006L;
private TaskInfoService taskInfoService;
private List
private PageRequest
<%@ taglib uri="http://displaytag.sf.net" prefix="display"%>
requestURI="songsTaskList.action" class="table">
**********************application-action-sys.xml
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"
default-autowire="byName">
***********************application-dao.xml
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"
default-autowire="byName">
******************application-core.xml
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"
default-autowire="byName">
*********************application-service.xml
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"
default-autowire="byName">