1 19 20 package com.sslexplorer.properties; 21 22 import java.util.ArrayList ; 23 import java.util.Iterator ; 24 import java.util.List ; 25 26 import javax.servlet.http.HttpServletRequest ; 27 28 import com.sslexplorer.security.Constants; 29 30 36 public class ProfilesListDataSource implements PairListDataSource { 37 38 41 public final static String SELECT_ON_LOGIN = "selectOnLogin"; 42 43 48 public List <Pair> getValues(HttpServletRequest request) { 49 List <Pair> l = new ArrayList <Pair>(); 50 l.add(new Pair(SELECT_ON_LOGIN, "Select on login")); 52 List propertyProfiles = (List ) request.getSession().getAttribute(Constants.PROFILES); 53 if (propertyProfiles != null) { 54 for (Iterator i = propertyProfiles.iterator(); i.hasNext();) { 55 PropertyProfile pf = (PropertyProfile) i.next(); 56 l.add(new Pair(new Integer (pf.getResourceId()), pf.getResourceName())); 57 } 58 } 59 return l; 60 } 61 62 } 63 | Popular Tags |