静态服务JSF组件框架Javascript和CSS
|
我正在使用RichFaces 3.3.1,我试图找出是否有一种方法可以将RichFaces CSS和Javascript作为静态资源从其他Web服务器(如Apache或Nginx)托管。
我尝试将web.xml中的“ 0”初始化参数设置为其他Web服务器,但是URI仍然相对于Web应用程序。
我还尝试从RichFaces jar中提取两个Javascript文件
framework.pack.js
ui.pack.js
在web.xml中添加了以下内容。
<context-param>
<param-name>org.richfaces.LoadScriptStrategy</param-name>
<param-value>NONE</param-value>
</context-param>
然后在xhtml中包含来自其他服务器的Javascript文件。不幸的是,在执行此操作之后,许多RichFaces组件均无法正常工作。
还有其他想法可以做到这一点吗?
有没有人在使用JSF组件框架方面取得任何成功?
没有找到相关结果
已邀请:
1 个回复
剑哎
然后在META-INF中可以包含静态资源映射文件。完整路径/文件名是: META-INF / richfaces / static-resource-mappings.properties 其内容如下:
编辑: 我有时做的另一件事(在JSF 2中)只是取消了库提供程序包括的资源版本。然后,我只是创建一个静态版本,并将其自己包含在我的facelets模板中或在您的项目中有意义的任何地方。它虽然不太优雅,但是如果您组合资源以提高性能等,它会很好地工作。 为此,我首先通过将其添加到faces-config.xml中,为脚本和样式表定义一些客户渲染器: faces-config.xml
然后,将一些要抑制的文件或类添加到web.xml中: web.xml
ScriptRenderer.java
ScriptRenderer.java