fastjson读取json配置文件:
ClassLoader loader=FileUtil.class.getClassLoader(); InputStream stream=loader.getResourceAsStream("template.json"); String text = IOUtils.toString(stream,"utf8"); ParserModule module = JSON.parseObject(text, ParserModule.class);
依赖:
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import com.alibaba.fastjson.JSON;