/** * Checks the value of an XML attribute which represents a redirect URL. If not empty * or starting with "$" (potential placeholder), or starting with "#" (potential * SpEL), "/" or "http" it will raise an error. */ static void validateHttpRedirect(String url, ParserContext pc, Object source) { if (!StringUtils.hasText(url) || UrlUtils.isValidRedirectUrl(url) || url.startsWith("$") || url.startsWith("#")) { return; } pc.getReaderContext().warning( url + " is not a valid redirect URL (must start with '/' or http(s))", source); }
protected void parseTypeFilters(Element element, ClassPathBeanDefinitionScanner scanner, ParserContext parserContext) { // Parse exclude and include filter elements. ClassLoader classLoader = scanner.getResourceLoader().getClassLoader(); NodeList nodeList = element.getChildNodes(); for (int i = 0; i < nodeList.getLength(); i++) { Node node = nodeList.item(i); if (node.getNodeType() == Node.ELEMENT_NODE) { String localName = parserContext.getDelegate().getLocalName(node); try { if (INCLUDE_FILTER_ELEMENT.equals(localName)) { TypeFilter typeFilter = createTypeFilter((Element) node, classLoader, parserContext); scanner.addIncludeFilter(typeFilter); } else if (EXCLUDE_FILTER_ELEMENT.equals(localName)) { TypeFilter typeFilter = createTypeFilter((Element) node, classLoader, parserContext); scanner.addExcludeFilter(typeFilter); } } catch (ClassNotFoundException ex) { parserContext.getReaderContext().warning( "Ignoring non-present type filter class: " + ex, parserContext.extractSource(element)); } catch (Exception ex) { parserContext.getReaderContext().error( ex.getMessage(), parserContext.extractSource(element), ex.getCause()); } } } }
if (isSimpleContainer) { if (!("auto".equals(cache) || "consumer".equals(cache))) { parserContext.getReaderContext().warning( "'cache' attribute not actively supported for listener container of type \"simple\". " + "Effective runtime behavior will be equivalent to \"consumer\" / \"auto\".", containerEle);
context.getReaderContext().warning("Missing value for pin entry.", hpkpElement); continue;
protected void parseTypeFilters(Element element, ClassPathBeanDefinitionScanner scanner, ParserContext parserContext) { // Parse exclude and include filter elements. ClassLoader classLoader = scanner.getResourceLoader().getClassLoader(); NodeList nodeList = element.getChildNodes(); for (int i = 0; i < nodeList.getLength(); i++) { Node node = nodeList.item(i); if (node.getNodeType() == Node.ELEMENT_NODE) { String localName = parserContext.getDelegate().getLocalName(node); try { if (INCLUDE_FILTER_ELEMENT.equals(localName)) { TypeFilter typeFilter = createTypeFilter((Element) node, classLoader, parserContext); scanner.addIncludeFilter(typeFilter); } else if (EXCLUDE_FILTER_ELEMENT.equals(localName)) { TypeFilter typeFilter = createTypeFilter((Element) node, classLoader, parserContext); scanner.addExcludeFilter(typeFilter); } } catch (ClassNotFoundException ex) { parserContext.getReaderContext().warning( "Ignoring non-present type filter class: " + ex, parserContext.extractSource(element)); } catch (Exception ex) { parserContext.getReaderContext().error( ex.getMessage(), parserContext.extractSource(element), ex.getCause()); } } } }
pc.getReaderContext().warning("Duplicate URL defined: " + path + ". The original attribute values will be overwritten", pc.extractSource(filterPattern));
pc.getReaderContext().warning("Duplicate URL defined: " + path + ". The original attribute values will be overwritten", pc.extractSource(filterPattern));
parserContext.getReaderContext().warning( "Attribute 'hash' cannot be used with 'password-encoder' and " + "will be ignored.",
pc.getReaderContext().warning( "Overriding globally registered AuthenticationManager", pc.extractSource(element));
/** * Checks the value of an XML attribute which represents a redirect URL. If not empty * or starting with "$" (potential placeholder), or starting with "#" (potential * SpEL), "/" or "http" it will raise an error. */ static void validateHttpRedirect(String url, ParserContext pc, Object source) { if (!StringUtils.hasText(url) || UrlUtils.isValidRedirectUrl(url) || url.startsWith("$") || url.startsWith("#")) { return; } pc.getReaderContext().warning( url + " is not a valid redirect URL (must start with '/' or http(s))", source); }
@Override public BeanDefinition parse(final Element element, ParserContext parserContext) { if (HttpContextUtils.WEB_MVC_PRESENT) { this.graphControllerRegistrar.registerBeanDefinitions( new StandardAnnotationMetadata(IntegrationGraphControllerParser.class) { @Override public Map<String, Object> getAnnotationAttributes(String annotationType) { return Collections.<String, Object>singletonMap("value", element.getAttribute("path")); } }, parserContext.getRegistry()); } else { parserContext.getReaderContext().warning("The 'IntegrationGraphController' isn't registered " + "with the application context because" + " there is no 'org.springframework.web.servlet.DispatcherServlet' in the classpath.", element); } return null; }
context.getReaderContext().warning("Missing value for pin entry.", hpkpElement); continue;
if (StringUtils.hasText(extractPayload)) { parserContext.getReaderContext() .warning("Setting 'extract-payload' attribute has no effect when used with " + "a marshalling Web Service Outbound Gateway.", element);
parserContext.getReaderContext().warning( "Attribute 'hash' cannot be used with 'password-encoder' and " + "will be ignored.",
pc.getReaderContext().warning( "Overriding globally registered AuthenticationManager", pc.extractSource(element));
if (containerType.startsWith("simple")) { if (!("auto".equals(cache) || "consumer".equals(cache))) { parserContext.getReaderContext().warning( "'cache' attribute not actively supported for listener container of type \"simple\". " + "Effective runtime behavior will be equivalent to \"consumer\" / \"auto\".", element);
&& StringUtils.hasText(subElement.getAttribute("type"))) { parserContext.getReaderContext() .warning("The use of a 'type' attribute is deprecated since 4.0 " + "when using 'expression'", subElement);
private void checkForDeprecatedSessionControllerRef(Element element, ParserContext pc) { final String ATT_SESSION_CONTROLLER_REF = "session-controller-ref"; if (StringUtils.hasText(element.getAttribute(ATT_SESSION_CONTROLLER_REF))) { pc.getReaderContext().warning(ATT_SESSION_CONTROLLER_REF + " is not supported in Spring Security " + " 3.0 and will be ignored. Use the attribute on the <concurrent-session-control> element instead.", pc.extractSource(element)); } }