java web中resources路径

UserBean.class.getClassLoader().getResource(filePath).getPath()

或者

Thread.currentThread().getContextClassLoader().getResource(filepath).getPath();
原文地址:https://www.cnblogs.com/lishupeng/p/8184741.html