for (int i = 0; i < portletNames.length; i++) {
debugWithName("Processing portlet name: " + portletNames[i]);
int index = portletNames[i].indexOf("/");
String contextPath = "/" + portletNames[i].substring(0, index);
String portletName = portletNames[i].substring(index + 1);
pageConfig.addPortlet(contextPath, portletName);
adminConfig.getPortletRegistryAdminService()
.addPortletApplication(contextPath);
}
adminConfig.getRenderConfigAdminService().addPage(pageConfig);