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