首页>代码>spring mvc+velocity实现.vm文件中获取项目地址>/velocityTestPath/src/velocity/test/utils/SteadyResPath.java
package velocity.test.utils; import java.util.Properties; import com.talkweb.framework.core.modules.utils.resource.PropertiesLoadUtils; //继承VelocityToolbox2View类,set自定义资源路径 public class SteadyResPath extends VelocityToolbox2View { private static final String CONFIG_FILE = "properties/steady-resource-url.properties"; private static String rootPath = null; /** * 获取静态资源地址前缀 * * @return 静态资源地址前缀 */ public static String getRootPath() { Properties properties = PropertiesLoadUtils.loadProperties(CONFIG_FILE); if (rootPath == null) { rootPath = properties.getProperty("steady.resource.host"); } return rootPath; } /** * 设置静态资源地址前缀 * * @param rootPath */ public void setRootPath(String rootPath) { SteadyResPath.rootPath = rootPath; } }


2039995605 LV9
2022年11月2日
一个人的咖啡 LV5
2021年6月15日
ningmeng2020 LV2
2020年10月28日
jxly007 LV8
2020年9月22日
小翊杭宝 LV2
2020年9月11日
vinod1213 LV12
2020年8月26日
fictain LV7
2020年5月25日
977670 LV3
2018年12月12日
hefenyuan91 LV11
2018年9月29日
ganglianhuo LV9
2018年9月18日