【发布时间】:2015-09-01 11:11:44
【问题描述】:
我有许多使用<ui:composition> 的JSF 页面。假设我有以下页面
-
common.xhtml(这里定义head和body。它是所有页面的父/主/首页) -
p1.xhtml(包含在common.xhtml中,使用<ui:composition>) -
p2.xhtml(包含在common.xhtml中,使用<ui:composition>) -
p3.xhtml(包含在common.xhtml中使用<ui:composition>并且我想在此页面点击时重新加载 JF 和 css 文件)
我通过this 链接,但这对我没有帮助,因为我必须将标题放在common.xhtml 中(这将停止缓存所有 JF 和 CSS 文件,我不想要这个。)
当p3.xhtml 命中时,我如何仅重新加载 js 和 css 文件?
编辑
我在common.xhtml添加了关注
<h:head>
....
<ui:insert name="metaTags" />
</h:head>
我在p3.xhtml添加了关注
<ui:define name="metaTags">
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="pragma" content="no-cache" />
</ui:define>
但它仍然没有选择我更新的 js 文件。
【问题讨论】:
标签: jsf caching jsf-2 facelets