public void addFromConfig(PrettyConfig config) { if (config != null) { mappings.addAll(config.getMappings()); rewriteRules.addAll(config.getGlobalRewriteRules()); } }
public void addFromConfig(PrettyConfig config) { if (config != null) { mappings.addAll(config.getMappings()); rewriteRules.addAll(config.getGlobalRewriteRules()); } }
public void addFromConfig(PrettyConfig config) { if (config != null) { mappings.addAll(config.getMappings()); rewriteRules.addAll(config.getGlobalRewriteRules()); } }
public void addFromConfig(PrettyConfig config) { if (config != null) { mappings.addAll(config.getMappings()); rewriteRules.addAll(config.getGlobalRewriteRules()); } }
public PrettyConfig processConfiguration(ServletContext context, PrettyConfig config) { String enabled = context.getInitParameter(VALIDATION_ENABLED_PARAM); if ((enabled != null) && "false".equalsIgnoreCase(enabled.trim())) { return config; } for (UrlMapping m : config.getMappings()) { m.getPatternParser(); } 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; }
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(VALIDATION_ENABLED_PARAM); if ((enabled != null) && "false".equalsIgnoreCase(enabled.trim())) { return config; } for (UrlMapping m : config.getMappings()) { m.getPatternParser(); } return config; } }
@Override public PrettyConfig processConfiguration(ServletContext context, PrettyConfig config) { String enabled = context.getInitParameter(VALIDATION_ENABLED_PARAM); if ((enabled != null) && "false".equalsIgnoreCase(enabled.trim())) { return config; } for (UrlMapping m : config.getMappings()) { m.getPatternParser(); } 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; }
public PrettyConfig processConfiguration(ServletContext context, PrettyConfig config) { String enabled = context.getInitParameter(VALIDATION_ENABLED_PARAM); if ((enabled != null) && "false".equalsIgnoreCase(enabled.trim())) { return config; } for (UrlMapping m : config.getMappings()) { m.getPatternParser(); } return config; } }
/** * Get the {@link UrlMapping} corresponding with the given mapping id. * * @param id Mapping id * @return PrettyUrlMapping Corresponding mapping */ public UrlMapping getMappingById(String id) { if (id != null) { if (id.startsWith(PrettyContext.PRETTY_PREFIX)) { id = id.substring(PrettyContext.PRETTY_PREFIX.length()); } for (UrlMapping mapping : getMappings()) { if (mapping.getId().equals(id)) { return mapping; } } } return null; }
/** * Get the {@link UrlMapping} corresponding with the given mapping id. * * @param id Mapping id * @return PrettyUrlMapping Corresponding mapping */ public UrlMapping getMappingById(String id) { if (id != null) { if (id.startsWith(PrettyContext.PRETTY_PREFIX)) { id = id.substring(PrettyContext.PRETTY_PREFIX.length()); } for (UrlMapping mapping : getMappings()) { if (mapping.getId().equals(id)) { return mapping; } } } return null; }
/** * Get the {@link UrlMapping} corresponding with the given mapping id. * * @param id Mapping id * @return PrettyUrlMapping Corresponding mapping */ public UrlMapping getMappingById(String id) { if (id != null) { if (id.startsWith(PrettyContext.PRETTY_PREFIX)) { id = id.substring(PrettyContext.PRETTY_PREFIX.length()); } for (UrlMapping mapping : getMappings()) { if (mapping.getId().equals(id)) { return mapping; } } } return null; }
/** * Search through all currently configured {@link UrlMapping} objects for the first one that matches the given URL. * * @return the first appropriate {@link UrlMapping} for a given URL. */ public UrlMapping getMappingForUrl(final URL url) { final String mappingKey = url.toURL(); if (cachedMappings.containsKey(mappingKey)) { return cachedMappings.get(mappingKey); } for (UrlMapping mapping : getMappings()) { if (mapping.matches(url)) { if (!mapping.getPatternParser().isElPattern()) { cachedMappings.put(mappingKey, mapping); } return mapping; } } return null; }
/** * Search through all currently configured {@link UrlMapping} objects for the first one that matches the given URL. * * @return the first appropriate {@link UrlMapping} for a given URL. */ public UrlMapping getMappingForUrl(final URL url) { final String mappingKey = url.toURL(); if (cachedMappings.containsKey(mappingKey)) { return cachedMappings.get(mappingKey); } for (UrlMapping mapping : getMappings()) { if (mapping.matches(url)) { if (!mapping.getPatternParser().isElPattern()) { cachedMappings.put(mappingKey, mapping); } return mapping; } } return null; }
/** * Search through all currently configured {@link UrlMapping} objects for the first one that matches the given URL. * * @return the first appropriate {@link UrlMapping} for a given URL. */ public UrlMapping getMappingForUrl(final URL url) { final String mappingKey = url.toURL(); if (cachedMappings.containsKey(mappingKey)) { return cachedMappings.get(mappingKey); } for (UrlMapping mapping : getMappings()) { if (mapping.matches(url)) { if (!mapping.getPatternParser().isElPattern()) { cachedMappings.put(mappingKey, mapping); } return mapping; } } return null; }
/** * Search through all currently configured {@link UrlMapping} objects for the first one that matches the given URL. * * @return the first appropriate {@link UrlMapping} for a given URL. */ public UrlMapping getMappingForUrl(final URL url) { final String mappingKey = url.toURL(); if (cachedMappings.containsKey(mappingKey)) { return cachedMappings.get(mappingKey); } for (UrlMapping mapping : getMappings()) { if (mapping.matches(url)) { if (!mapping.getPatternParser().isElPattern()) { cachedMappings.put(mappingKey, mapping); } return mapping; } } return null; }
public Configuration getConfiguration(final ServletContext context) { ConfigurationBuilder builder = ConfigurationBuilder.begin(); PrettyConfig config = (PrettyConfig) context.getAttribute(PrettyContext.CONFIG_KEY); if (config != null) { List<RewriteRule> rules = config.getGlobalRewriteRules(); List<UrlMapping> mappings = config.getMappings(); for (RewriteRule rule : rules) { builder.addRule(new InboundRewriteRuleAdaptor(rule)); } for (UrlMapping mapping : mappings) { builder.addRule(new UrlMappingRuleAdaptor(mapping)); } for (RewriteRule rule : rules) { builder.addRule(new OutboundRewriteRuleAdaptor(rule)); } } return builder; }