PortletDD portlet) {
if(debug) {
System.out.println("<VERBOSE> Creating Servlet Mapping for Portlet: '"+portlet.getPortletName()+"'");
}
String url= "/"+portlet.getPortletName().replace(' ', '_') + "/*";
ServletMappingDD servletMapping = webApp.getServletMapping(url);
if (servletMapping != null) {
String nm = servletMapping.getServletName();
if (!nm.equals(portlet.getPortletName())) {
System.out.println(
"Note: Replaced Servlet Mapping with pattern: "+url
);
servletMapping.setServletName(portlet.getPortletName());
}
}
else {
servletMapping = new ServletMappingDD();
servletMapping.setUrlPattern(url);
servletMapping.setServletName(portlet.getPortletName());
webApp.getServletMappings().add(servletMapping);
}
}