public PrettyConfig processConfiguration(ServletContext context, PrettyConfig config) { String enabled = context.getInitParameter(HIERARCHY_ENABLED_PARAM); if ((enabled != null) && "false".equalsIgnoreCase(enabled.trim())) { return config; } List<UrlMapping> mappings = config.getMappings(); for (UrlMapping m : mappings) { createAncestry(config, m); } return config; }
public PrettyConfig processConfiguration(ServletContext context, PrettyConfig config) { String enabled = context.getInitParameter(HIERARCHY_ENABLED_PARAM); if ((enabled != null) && "false".equalsIgnoreCase(enabled.trim())) { return config; } List<UrlMapping> mappings = config.getMappings(); for (UrlMapping m : mappings) { createAncestry(config, m); } return config; }
public PrettyConfig processConfiguration(ServletContext context, PrettyConfig config) { String enabled = context.getInitParameter(HIERARCHY_ENABLED_PARAM); if ((enabled != null) && "false".equalsIgnoreCase(enabled.trim())) { return config; } List<UrlMapping> mappings = config.getMappings(); for (UrlMapping m : mappings) { createAncestry(config, m); } return config; }
@Override public PrettyConfig processConfiguration(ServletContext context, PrettyConfig config) { String enabled = context.getInitParameter(HIERARCHY_ENABLED_PARAM); if ((enabled != null) && "false".equalsIgnoreCase(enabled.trim())) { return config; } List<UrlMapping> mappings = config.getMappings(); for (UrlMapping m : mappings) { createAncestry(config, m); } return config; }
private void createAncestry(PrettyConfig config, UrlMapping m) { if (m.hasParent() && !seen.contains(m)) { UrlMapping parent = config.getMappingById(m.getParentId()); if (parent == null) { throw new PrettyException("Error when building configuration for URL-mapping [" + m.getId() + ":" + m.getPattern() + "] - the requested parentId [" + m.getParentId() + "] does not exist in the configuration."); } if (parent.hasParent()) { createAncestry(config, parent); } m.setPattern(parent.getPattern() + m.getPattern()); mergeValidators(parent, m); mergeActions(parent, m); mergeQueryParams(parent, m); seen.add(m); } }
private void createAncestry(PrettyConfig config, UrlMapping m) { if (m.hasParent() && !seen.contains(m)) { UrlMapping parent = config.getMappingById(m.getParentId()); if (parent == null) { throw new PrettyException("Error when building configuration for URL-mapping [" + m.getId() + ":" + m.getPattern() + "] - the requested parentId [" + m.getParentId() + "] does not exist in the configuration."); } if (parent.hasParent()) { createAncestry(config, parent); } m.setPattern(parent.getPattern() + m.getPattern()); mergeValidators(parent, m); mergeActions(parent, m); mergeQueryParams(parent, m); seen.add(m); } }
private void createAncestry(PrettyConfig config, UrlMapping m) { if (m.hasParent() && !seen.contains(m)) { UrlMapping parent = config.getMappingById(m.getParentId()); if (parent == null) { throw new PrettyException("Error when building configuration for URL-mapping [" + m.getId() + ":" + m.getPattern() + "] - the requested parentId [" + m.getParentId() + "] does not exist in the configuration."); } if (parent.hasParent()) { createAncestry(config, parent); } m.setPattern(parent.getPattern() + m.getPattern()); mergeValidators(parent, m); mergeActions(parent, m); mergeQueryParams(parent, m); seen.add(m); } }
private void createAncestry(PrettyConfig config, UrlMapping m) { if (m.hasParent() && !seen.contains(m)) { UrlMapping parent = config.getMappingById(m.getParentId()); if (parent == null) { throw new PrettyException("Error when building configuration for URL-mapping [" + m.getId() + ":" + m.getPattern() + "] - the requested parentId [" + m.getParentId() + "] does not exist in the configuration."); } if (parent.hasParent()) { createAncestry(config, parent); } m.setPattern(parent.getPattern() + m.getPattern()); mergeValidators(parent, m); mergeActions(parent, m); mergeQueryParams(parent, m); seen.add(m); } }