提交 91ac0bfe 编写于 作者: J Juergen Hoeller

Reinstated support for spring-beans.dtd (streamlined like xsd)

Issue: SPR-13499
上级 5ea8c267
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -30,8 +30,8 @@ import org.springframework.core.io.Resource;
* EntityResolver implementation for the Spring beans DTD,
* to load the DTD from the Spring class path (or JAR file).
*
* <p>Fetches "spring-beans-2.0.dtd" from the class path resource
* "/org/springframework/beans/factory/xml/spring-beans-2.0.dtd",
* <p>Fetches "spring-beans.dtd" from the class path resource
* "/org/springframework/beans/factory/xml/spring-beans.dtd",
* no matter whether specified as some local URL that includes "spring-beans"
* in the DTD name or as "http://www.springframework.org/dtd/spring-beans-2.0.dtd".
*
......@@ -44,8 +44,6 @@ public class BeansDtdResolver implements EntityResolver {
private static final String DTD_EXTENSION = ".dtd";
private static final String DTD_FILENAME = "spring-beans-2.0";
private static final String DTD_NAME = "spring-beans";
private static final Log logger = LogFactory.getLog(BeansDtdResolver.class);
......@@ -61,7 +59,7 @@ public class BeansDtdResolver implements EntityResolver {
int lastPathSeparator = systemId.lastIndexOf("/");
int dtdNameStart = systemId.indexOf(DTD_NAME, lastPathSeparator);
if (dtdNameStart != -1) {
String dtdFile = DTD_FILENAME + DTD_EXTENSION;
String dtdFile = DTD_NAME + DTD_EXTENSION;
if (logger.isTraceEnabled()) {
logger.trace("Trying to locate [" + dtdFile + "] in Spring jar on classpath");
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册