0

JSF フローを作成しました。私の定義は次のとおりです。

<flow-definition id="registration">
    <initializer>#{registrationBean.initializeFlow}</initializer>

    <start-node>personalDetails</start-node>

    <view id="personalDetails">
        <vdl-document>/registration/personal-details.xhtml</vdl-document>
    </view>

    <navigation-rule>
        <from-view-id>*</from-view-id>
        <navigation-case>
            <from-outcome>registration</from-outcome>
            <to-view-id>/registration/personal-details.xhtml</to-view-id>
        </navigation-case>
    </navigation-rule>

    <navigation-rule>
        <from-view-id>/registration/personal-details.xhtml</from-view-id>
        <navigation-case>
            <from-outcome>next</from-outcome>
            <to-view-id>/registration/cultural-details.xhtml</to-view-id>
        </navigation-case>
    </navigation-rule>

    <navigation-rule>
        <from-view-id>/registration/cultural-details.xhtml</from-view-id>
        <navigation-case>
            <from-outcome>previous</from-outcome>
            <to-view-id>/registration/personal-details.xhtml</to-view-id>
        </navigation-case>
        <navigation-case>
            <from-outcome>next</from-outcome>
            <to-view-id>/registration/profile-details.xhtml</to-view-id>
        </navigation-case>
    </navigation-rule>

    <navigation-rule>
        <from-view-id>/registration/profile-details.xhtml</from-view-id>
        <navigation-case>
            <from-outcome>previous</from-outcome>
            <to-view-id>/registration/cultural-details.xhtml</to-view-id>
        </navigation-case>
        <navigation-case>
            <from-outcome>next</from-outcome>
            <to-view-id>/registration/preview.xhtml</to-view-id>
        </navigation-case>
    </navigation-rule>

    <navigation-rule>
        <from-view-id>/registration/preview.xhtml</from-view-id>
        <navigation-case>
            <from-outcome>previous</from-outcome>
            <to-view-id>/registration/profile-details.xhtml</to-view-id>
        </navigation-case>
        <navigation-case>
            <from-outcome>success</from-outcome>
            <to-view-id>/registration-complete.xhtml</to-view-id>
        </navigation-case>
    </navigation-rule>

    <flow-return id="cancel">
        <from-outcome>cancel</from-outcome>
    </flow-return>

    <finalizer>#{registrationBean.finalizeFlow}</finalizer>
</flow-definition>

Faces フローを移動すると、実際のフロー ページには問題はありませんが、テンプレートは奇妙なエラーを出力しています。

Unable to find matching navigation case from view ID '/registration/personal-details.xhtml' for outcome 'registration' 

/registration/personal-details.xhtmlは現在のファイル名registrationで、 は現在のフロー スコープの名前です。

メニューにあるレンダリングされたリンクも次のようにレンダリングされます。

Sign Up

フローの外側、または:

Sign Up: This link is disabled because a navigation case could not be matched.

流れの中。

同時に、Glassfish のログには次のように表示されます。

Warning:   JSF1064: Unable to find or serve resource, /registration/registration.xhtml.

これregistration.xhtmlは存在しませんが、config.xml を変更することでデフォルトのファイル名を上書きできると思い<start-node>ました。

ファイル構造をデフォルト以外の値のままにして、これを機能させる方法はありますか? 問題は正確には何ですか?

4

2 に答える 2

0

XML 構成の代わりに @Producer メソッド内で FlowBuilder を使用して、開始ページの名前を変更する (または任意のディレクトリで任意のフェイス ページを使用する) ことができます。

参照: https://blog.oio.de/2014/02/12/a-comprehensive-example-of-jsf-faces-flow/

これには、face-config.xml からコード ベースの構成に切り替える必要があります... Faces/ディレクトリ ベースの構成はあまり柔軟ではなく、標準の規則に従う必要があります。

于 2015-05-12T23:23:54.610 に答える