/** * Test this mapping against a given URL. * * @return True if this mapping matches the URL, false if not. */ public boolean matches(final URL url) { return getPatternParser().matches(url); }
/** * Test this mapping against a given URL. * * @return True if this mapping matches the URL, false if not. */ public boolean matches(final URL url) { return getPatternParser().matches(url); }
/** * Test this mapping against a given URL. * * @return True if this mapping matches the URL, false if not. */ public boolean matches(final URL url) { return getPatternParser().matches(url); }
public int compare(final UrlMapping l, final UrlMapping r) { if (l.getPatternParser().getParameterCount() < r.getPatternParser().getParameterCount()) { return 1; } else if (l.getPatternParser().getParameterCount() > r.getPatternParser().getParameterCount()) { return -1; } return 0; } };
public int compare(final UrlMapping l, final UrlMapping r) { if (l.getPatternParser().getParameterCount() < r.getPatternParser().getParameterCount()) { return 1; } else if (l.getPatternParser().getParameterCount() > r.getPatternParser().getParameterCount()) { return -1; } return 0; } };
/** * Test this mapping against a given URL. * * @return True if this mapping matches the URL, false if not. */ public boolean matches(final URL url) { return getPatternParser().matches(url); }
public int compare(final UrlMapping l, final UrlMapping r) { if (l.getPatternParser().getParameterCount() < r.getPatternParser().getParameterCount()) { return 1; } else if (l.getPatternParser().getParameterCount() > r.getPatternParser().getParameterCount()) { return -1; } return 0; } };
public int compare(final UrlMapping l, final UrlMapping r) { if (l.getPatternParser().getParameterCount() < r.getPatternParser().getParameterCount()) { return 1; } else if (l.getPatternParser().getParameterCount() > r.getPatternParser().getParameterCount()) { return -1; } return 0; } };
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(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; } }
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; } }
/** * 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; }
@Override public Map<String, String[]> getAdditionalParameters(final ServletRequest request, final ServletResponse response) { PrettyContext context = PrettyContext.getCurrentInstance((HttpServletRequest)request); PrettyConfig config = context.getConfig(); URL url = context.getRequestURL(); if (config.isURLMapped(url)) { List<PathParameter> params = context.getCurrentMapping().getPatternParser().parse(url); QueryString query = QueryString.build(params); return query.getParameterMap(); } return null; }
List<PathParameter> params = mapping.getPatternParser().parse(url); for (PathParameter param : params)
List<PathParameter> params = mapping.getPatternParser().parse(url); for (PathParameter param : params)
List<PathParameter> params = mapping.getPatternParser().parse(url); for (PathParameter param : params)