HI ALL,
I have a problem in JSP.
I want to display 10 records per page.If i click on next button it shld display next 10 records.Similarly for previous button.
I don't want to use TAG library (Pager...)
Plzzz tell me other than this....
-
Displaying 10 records per page using jsp (4 messages)
- Posted by: suresh kumar
- Posted on: November 22 2004 01:28 EST
Threaded Messages (4)
- But why not use a tag library? by Kris Thompson on November 22 2004 09:32 EST
- Displaying 10 records per page using jsp by Raghu Kodali on November 22 2004 17:50 EST
- Displaying 10 records per page using jsp by Per Joergensen on November 23 2004 05:11 EST
- Displaying 10 records per page using jsp by Per Joergensen on November 23 2004 05:14 EST
-
But why not use a tag library?[ Go to top ]
- Posted by: Kris Thompson
- Posted on: November 22 2004 09:32 EST
- in response to suresh kumar
I just have to ask because I can't imagine a reason for not using a tag library like displaytag or valuelist for this type of problem, because my answer would be to replicate the code in one of those projects for your solution -;)
Kris Thompson -
Displaying 10 records per page using jsp[ Go to top ]
- Posted by: Raghu Kodali
- Posted on: November 22 2004 17:50 EST
- in response to suresh kumar
Some of the MVC based frameworks implement this range paging pattern. One of the framework that does this is ADF. In case you are interested to use a framework, you can check out ADF.
http://www.oracle.com/technology/products/jdev/collateral/papers/10g/ADF_overview.pdf -
Displaying 10 records per page using jsp[ Go to top ]
- Posted by: Per Joergensen
- Posted on: November 23 2004 05:11 EST
- in response to suresh kumar
Hallo
If you have make a searchresult bean something like
public SearchResultBean {
private SearchData[] searchData;
private int index = 0;
/**
** Count the index back x position
*/
public void previous();
/**
** Count the index forward x position
*/
public void next();
/**
*
public Collection getData();
} -
Displaying 10 records per page using jsp[ Go to top ]
- Posted by: Per Joergensen
- Posted on: November 23 2004 05:14 EST
- in response to suresh kumar
.. was not complete
If you have make a searchresult bean something like
public SearchResultBean {
private SearchData[] searchData;
private int index = 0;
/**
** Count the index back x position
*/
public void previous();
/**
** Count the index forward x position
*/
public void next();
/**
* Return the SearchData from index and x position forward
*/
public Collection getData();
}
And in the JSP your just iterate on over the SearchResultBean.getData() collection
adding two buttons forward and back, and remember to store you bean in session.
Hope this helps!
/Per