arrow_back history picture_as_pdf This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ~~NOTRANS~~ ~~Title: Standard Sorting on the Server Side~~ User-friendly UIs prepare and display data in clearly arranged form. This includes clear and relevant sorting of data. There are several different ways to sort data and sorting can happen at various tiers. The client (client tier) can handle sorting, although that would mean that unwanted logic is located at the client. The database (data tier) also offers ways to sort data, for example, through the use of views. Unfortunately not all databases supporting sorting using views. That only leaves the application server and therefore the business logic (enterprise tier) for sorting. The following instruction sorts the data. Please note that this is standard sorting. If the client requests a different sorting method, it will be preferred. <file java> public DBStorage getUserDefaults() throws Exception { DBStorage userDefaults = (DBStorage)get("userDefaults"); if (userDefaults == null) { userDefaults = new DBStorage(); userDefaults.setDBAccess(getDBAccess()); userDefaults.setWritebackTable("USERS"); userDefaults.setDefaultSort(new SortDefinition(false, "USERNAME")); userDefaults.open(); put("userDefaults", userDefaults); } return userDefaults; } </file>