}
boolean found = false;
Iterator mappings = servletMappings.iterator();
while (mappings.hasNext()) {
ServletMappingImpl servletMapping =
(ServletMappingImpl) mappings.next();
if (servletMapping
.getServletName()
.equals(portlet.getName())) {
found = true;
servletMapping.setUrlPattern(
"/" + portlet.getName().replace(' ', '_') + "/*");
}
}
if (!found) {
ServletMappingImpl servletMapping =
new ServletMappingImpl();
servletMapping.setServletName(portlet.getName());
servletMapping.setUrlPattern(
"/" + portlet.getName().replace(' ', '_') + "/*");
servletMappings.add(servletMapping);
}
SecurityRoleRefSet servletSecurityRoleRefs =