java web项目发版js或css缓存问题解决方案给引入的js或css文件加版本号<%
// 加载资源文件
PropertiesResourceFileUtils prfu = new PropertiesResourceFileUtils("version.properties");
version=20161125.02
/**
/**
try {
InputStream in = PropertiesResourceFileUtils.class.getClassLoader().getResourceAsStream(propertiesPath);
if(in != null) {
properties.load(in);
}
}
catch (IOException e) {
e.printStackTrace();
}
} /**
public String getValue(String key){
String value = properties.getProperty(key);
if(StringUtils.isNotBlank(value))
try {
value = new String(value.getBytes("ISO-8859-1"), "UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return value;
}
}
版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。