如果解析 mybatis-config .xm l 配置文件,默认联网加载
http://mybatis.org/dtd/mybatis-3-config.dtd 这个 DTD 文档,当网络比较慢时会导致验证过程缓慢。
在实践中往往会提前设置 EntityResolver 接口对象加载本地的 DTD 文件,从而避免联网加载
DTD 文件。
/**
* Copyright 2009-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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.ibatis.builder.xml;
import java.io.IOException;
import java.io.InputStream;
import java.util.Locale;
import org.apache.ibatis.io.Resources;
import org.xml.sax