返回 一个map的方法
public static Map<String,List<String>> getUserProjectPermission(){
return (Map<String,List<String>>)DoradoContext.getAttachedRequest().getSession().getAttribute("projectPermissionMap");
}
获取到key的方法 单独取到key值
Map<String, List<String>> mapSP = Util.getUserProjectPermission();
Set entrySet = mapSP.entrySet();
Iterator iterator = mapSP.entrySet().iterator();
Object projectCode = "";
while(iterator.hasNext()){
Map.Entry entry = (Entry) iterator.next();
projectCode = entry.getKey();
entry.getValue();
}
private String getSectionStr(){
Map<String,List<String>> m = Util.getUserProjectPermission();
Iterator<Entry<String, List<String>>> iter = m.entrySet().iterator();
String sectionStr = "";
while(iter.hasNext()){
Map.Entry<String,List<String>> entry = (Map.Entry<String,List<String>>) iter.next();
List<String> sectionList = entry.getValue();
if(Util.isNull(sectionList)){
for(String sectioncode : sectionList){
if("".equals(sectionStr)){
sectionStr = "'"+sectioncode+"'";
}else{
sectionStr +=","+ "'"+sectioncode+"'";
}
}
}
}
return sectionStr;
}