File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes pagination Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of RabbitMQ in Depth this week in the Open Source forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "pagination" Watch "pagination" New topic


veda vyas

Joined: Apr 11, 2011
Posts: 3
i want to pass pagesize value dynamically from jsp how can i do this ,below i am putting my java class

public IExtendedPaginatedList getPaginatedListFromRequest(HttpServletRequest request){

IExtendedPaginatedList paginatedList = new PaginatedListImpl();
String sortCriterion = request.getParameter(IExtendedPaginatedList.IRequestParameters.SORT);
paginatedList.setSortDirection(IExtendedPaginatedList.IRequestParameters.DESC.equals(request.getParameter(IExtendedPaginatedList.IRequestParameters.DIRECTION))? SortOrderEnum.DESCENDING : SortOrderEnum.ASCENDING);
int pageSize = 25; // Rows per page
String thePage = request.getParameter(IExtendedPaginatedList.IRequestParameters.PAGE);
if(thePage != null){
int index = paginatedList == null? 0 : Integer.parseInt(thePage) - 1;

return paginatedList;

please help me
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3151

Please UseCodeTags and also TellTheDetails - we need to know what is the problem with the code you have provided or what are the exceptions being thrown. You could have a look at PaginationOrPaging which explains some approaches for Pagination.

Mohamed Sanaulla | My Blog
Paul Clapham

Joined: Oct 14, 2005
Posts: 19552

Two things:

(1) Remove the line which hard-codes the number of lines per page.

(2) Pass the number of lines per page as a parameter of the method.
I agree. Here's the link:
subject: pagination