在使用c:import直接去请求资源,jsp渲染的还是旧的资源
解决方法:
在请求页面时,可以加上随机数,如自动生成的时间戳,这样请求时每次都是新的url,就不必从缓存中直接去取资源了
用c:import标签请求缓存的原因是源码中并没有在url中加随机数的机制,所以才会出现这样的问题
public void setUrl(String url) throws JspTagException {
this.url = url;
}
// for tag attribute
public void setContext(String context) throws JspTagException {
this.context = context;
}
// for tag attribute
public void setCharEncoding(String charEncoding) throws JspTagException {
this.charEncoding = charEncoding;
}