// renderRequest.setAttribute("selectedContainer", chosenContainer);
// }
WebAccessLog chosenLog = null;
if(managers != null) {
for (int i = 0; i < managers.length; i++) {
WebManager manager = managers[i];
AbstractName managerName = PortletManager.getNameFor(renderRequest, manager);
WebContainer[] containers = (WebContainer[]) manager.getContainers();
if (containers != null) {
for (int j = 0; j < containers.length; j++) {
WebContainer container = containers[j];
AbstractName containerName = PortletManager.getNameFor(renderRequest, container);
String combined = managerName+"%"+containerName;
if(containers.length == 1) {
products.put(manager.getProductName(), combined);
} else {
products.put(manager.getProductName()+" ("+containerName.getName().get(NameFactory.J2EE_NAME)+")", combined);
}
if(chosenLog == null) { // will pick the correct match, or the first if no selection is specified
if(chosenContainer == null || chosenContainer.equals(combined)) {
chosenLog = PortletManager.getWebAccessLog(renderRequest, managerName, containerName);
}
}
}
} else {
log.error("No web containers found for manager "+manager.getProductName());
}
}
} else {
log.error("No web managers found!");
}