我在使用 JSF 2.0、PrimeFaces 和 tukey.org UrlRewriteFilter 时遇到问题。
问题是,如果我添加一个 PrimeFaces 组件(例如),页面(或任何资源的确切来源)不会加载定义 PrimeFaces 对象的 core.js。因此,该组件不会加载。
core.js 文件位于 META-INF/resources/primefaces/core/core.js 文件夹中的 primefaces-2.2.RC1.jar(位于 webapp 的 WEB-INF/lib 中)内。
我的 urlrewrite 规则如下:
<rule>
<from>/</from>
<to>/faces/pages/public/welcome.xhtml</to>
</rule>
<rule>
<from>/styles/**</from>
<to>/styles/$1</to>
</rule>
<rule>
<from>/images/**</from>
<to>/images/$1</to>
</rule>
<rule>
<from>/scripts/**</from>
<to>/scripts/$1</to>
</rule>
<rule>
<from>/flash/**</from>
<to>/flash/$1</to>
</rule>
<rule>
<from>/admin/*.xhtml</from>
<to>/faces/pages/admin/$1.xhtml</to>
</rule>
<rule>
<from>/*.xhtml</from>
<to>/faces/pages/public/$1.xhtml</to>
</rule>
<rule>
<from>/**</from>
<to>/$1</to>
</rule>
我想这是我的重写规则的问题,但我无法弄清楚到底出了什么问题。我需要的是 PrimeFaces 用来加载 core.js 文件的 URL,这样我就可以分析我的规则有什么问题。
有人知道如何解决这个问题吗?
谢谢大家的建议:)
最好的问候,罗伯特