Sortable Pageable List#
This example shows how to create a reusable component. The component is a list of Strings that are sortable, ascending and descending. The list should be pageable, so you can browse through entries. Because large lists can hurt performance, the list is filled only with the actual page, it does not select the content by itself.
- First create empty application
Data Access Layer#
Controller variant 1: not reusable#
Controller variant 2: reusable#
- open a command window and change to the tutorial/WEB-INF/classes directory
javac -cp ../lib/ztemplates.jar tutorial/helloworld/pageablelist/action/*.java tutorial/helloworld/pageablelist/service/*.java tutorial/helloworld/pageablelist/view/*.java
- restart tomcat
- open http://localhost:8080/tutorial/pageablelist/0/asc in your browser.