在Java Web项目中,不用ActionContext类来获得tomcat部署项目的绝对路径

例子:sendIosApns.class.getClassLoader().getResource("").getFile().replaceAll("%20", " ");

格式:类名..class.getClassLoader().getResource("").getFile().replaceAll("%20", " ");

原文地址:https://www.cnblogs.com/peijie-tech/p/4079084.html