Here you can find the source of sortingHelperSessions(String column, Map
public static String sortingHelperSessions(String column, Map<String, String> sortParams)
//package com.java2s; //License from project: Apache License import java.util.Map; public class Main { public static String sortingHelperSessions(String column, Map<String, String> sortParams) { String link_beginning = "<a href=\"gojara-activeSessions.jsp?sortby="; return helpMe(column, sortParams, link_beginning); }// w w w . ja v a 2s . c om private static String helpMe(String column, Map<String, String> sortParams, String link_beginning) { String image_asc = "<img alt=\"sorted ASC\" src=\"/images/sort_ascending.gif\">"; String image_desc = "<img alt=\"sorted DESC\" src=\"/images/sort_descending.gif\">"; String ending = ""; if (column.equals("username")) ending = "User Name:"; else if (column.equals("transport")) ending = "Resource:"; else if (column.equals("lastActivity")) ending = "Last Login was at:"; else if (column.equals("loginTime")) ending = "Login Time:"; else ending = "i dont want to be here"; ending += "</a>"; String sortinglink = ""; if (sortParams.containsValue(column)) { if (sortParams.containsValue("ASC")) { sortinglink = image_asc + link_beginning + column + "&sortorder=DESC\">" + ending; } else if (sortParams.containsValue("DESC")) { sortinglink = image_desc + link_beginning + column + "&sortorder=ASC\">" + ending; } } else { // This is not the currently sorted colum so we want to sort with it, Ascending. sortinglink = link_beginning + column + "&sortorder=ASC\">" + ending; } return sortinglink; } }