带 CDN 的 JSF 2 资源?
据我了解,JSF 2 资源的需求是帮助组织资源目录,并添加一些版本控制和本地化。
但是否可以将此功能与 CDN 结合起来?我以前从未使用过 CDN,但它看起来不错,并且想听听您对它的想法以及与 JSF 2 资源的可能组合,尽管我认为这不太可能。
As i understand it, the needs for JSF 2 resources is to help organizing resources directories, and add some versioning and localization.
But is it possible to combine this feature with a CDN ? I've never used CDN before, but it looks good, and would like to hear your ideas about it and possible combinations with JSF 2 resources, although i dont think it's likely.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于
和
来说这是不可能的,因为它们只能指向 webapp 自己的资源,而不能指向外部 URL。 JSF 人员已请求此功能。另请参阅 JSF 规范问题 598。目前计划在 2.2 版本发布,但我不认为它会在那时实现,因为它目前的投票数为 0。在此之前,您需要在
中使用纯 HTML和
自行指定它们>。如果需要,您可以将其设为模板定义,当然,当您想在每个视图的基础上定义它们时。
并
更新 JSF 实用程序库OmniFaces 自版本 1.2 起就有
CDNResourceHandler
可用,可用于自动在生产阶段运行时,将 JSF 资源替换为 CDN 资源。另请参阅CDNResourceHandler
展示页面。This is not possible with
<h:outputScript>
and<h:outputStylesheet>
yet, as they can only point to webapp's own resources, not to an external URL. This feature has already been requested to the JSF guys. See also JSF spec issue 598. Right now it's scheduled for 2.2, but I don't expect it to be already implemented then as it's currently at 0 votes.Until then, you'd need to specify them yourself using plain HTML
<link>
and<script>
in<h:head>
. You could make it a template definition if necessary, surely when you'd like to define them on a per-view basis.and
Update the JSF utility library OmniFaces has since version 1.2 a
CDNResourceHandler
available which could be used to automatically replace JSF resources by CDN resources when running in production stage. See also theCDNResourceHandler
showcase page.