1、获取resource目录下的template路径String path = Thread.currentThread().getContextClassLoader().getResource("").getPath()+"template";