【问题标题】:PrimeFaces and org.tuckey urlrewrite filterPrimeFaces 和 org.tukey urlrewrite 过滤器
【发布时间】:2010-11-16 23:17:14
【问题描述】:

我在使用 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,这样我就可以分析我的规则有什么问题。

有人知道如何解决这个问题吗?

谢谢大家的建议:)

最好的问候, 罗伯特

【问题讨论】:

  • 哎呀,对不起...我的意思是 PrimeFaces-object :)

标签: javascript jsf jsf-2 url-rewriting primefaces


【解决方案1】:

好的,我刚刚找到了答案。 urlrewrite 过滤器绝对没有问题。 相反,这只是我的 facelet-template 的问题。

模板使用了 head 和 body 标签,而不是 JSF 版本的“h:head”和“h:body”,PrimeFaces 需要存在“h:head”标签。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-10-27
    • 2011-12-04
    • 2012-03-22
    • 1970-01-01
    • 1970-01-01
    • 2012-01-09
    • 2011-12-08
    • 2014-01-04
    相关资源
    最近更新 更多