My favorites
|
Sign in
pagingappfuse
Hibernate DisplayTag external paging and sorting in Appfuse - Demo Project
Project Home
Downloads
Wiki
Issues
Source
Checkout
|
Browse
|
Changes
|
r52
Source path:
svn
/
trunk
/
src
/
main
/
java
/
com
/
pobox
/
paging
/
webapp
/
helper
/
PaginateListFactory.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package com.pobox.paging.webapp.helper;
import javax.servlet.http.HttpServletRequest;
import org.displaytag.properties.SortOrderEnum;
import org.springframework.web.servlet.mvc.Controller;
public class PaginateListFactory {
public ExtendedPaginatedList getPaginatedListFromRequest(
HttpServletRequest request) {
ExtendedPaginatedList paginatedList = new PaginatedListImpl();
String sortCriterion = null;
String thePage = null;
if (request != null) {
sortCriterion = request
.getParameter(ExtendedPaginatedList.IRequestParameters.SORT);
paginatedList
.setSortDirection(ExtendedPaginatedList.IRequestParameters.DESC
.equals(request
.getParameter(ExtendedPaginatedList.IRequestParameters.DIRECTION)) ? SortOrderEnum.DESCENDING
: SortOrderEnum.ASCENDING);
thePage = request
.getParameter(ExtendedPaginatedList.IRequestParameters.PAGE);
}
paginatedList.setSortCriterion(sortCriterion);
int pageSize = 25; // Rows per page
paginatedList.setPageSize(pageSize);
if (thePage != null) {
int index = paginatedList == null ? 0
: Integer.parseInt(thePage) - 1;
paginatedList.setIndex(index);
} else {
paginatedList.setIndex(0);
}
return paginatedList;
}
}
Show details
Hide details
Change log
r2
by chas66 on May 16, 2008
Diff
Initial checkin.
Go to:
/trunk/.classpath
/trunk/.project
/trunk/README.txt
/trunk/pom.xml
/trunk/src
/trunk/src/main
/trunk/src/main/java
/trunk/src/main/java/com
/trunk/src/main/java/com/pobox
...k/src/main/java/com/pobox/paging
...n/java/com/pobox/paging/App.java
...java/com/pobox/paging/dataaccess
.../dataaccess/PagingLookupDao.java
...ss/PagingLookupDaoHibernate.java
...aaccess/PagingLookupManager.java
...ess/PagingLookupManagerImpl.java
...main/java/com/pobox/paging/model
...obox/paging/model/Authority.java
...ain/java/com/pobox/paging/webapp
...m/pobox/paging/webapp/controller
...troller/AuthorityController.java
...ler/AuthorityFormController.java
...a/com/pobox/paging/webapp/helper
...elper/ExtendedPaginatedList.java
.../helper/PaginateListFactory.java
...pp/helper/PaginatedListImpl.java
/trunk/src/main/resources
.../ApplicationResources.properties
...plicationResources_de.properties
...plicationResources_en.properties
...plicationResources_es.properties
...plicationResources_fr.properties
...plicationResources_it.properties
...plicationResources_ko.properties
...plicationResources_nl.properties
...plicationResources_no.properties
...plicationResources_pt.properties
...cationResources_pt_BR.properties
...plicationResources_tr.properties
...plicationResources_zh.properties
...cationResources_zh_CN.properties
...cationResources_zh_TW.properties
/trunk/src/main/resources/META-INF
...sources/META-INF/persistence.xml
...applicationContext-resources.xml
.../main/resources/default-data.xml
...k/src/main/resources/ehcache.xml
...main/resources/hibernate.cfg.xml
...c/main/resources/jdbc.properties
/trunk/src/main/resources/log4j.xml
Project members,
sign in
to write a code review
Older revisions
All revisions of this file
File info
Size: 1510 bytes, 41 lines
View raw file
Hosted by