最近项目中发现,Struts2映射的子页面弹出时,数据不能实时更新,调研后找到解决方案。
将以下代码加入到页面中,可自动清除缓存。
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
本文介绍了解决Struts2框架中子页面数据无法实时更新的问题。通过在页面头部加入特定的元标签,可以有效防止浏览器缓存导致的数据不一致现象。
最近项目中发现,Struts2映射的子页面弹出时,数据不能实时更新,调研后找到解决方案。
将以下代码加入到页面中,可自动清除缓存。
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">

被折叠的 条评论
为什么被折叠?