我创建了一个 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 Flow 时,实际流页面中没有问题,但是模板输出了一个奇怪的错误:
Unable to find matching navigation case from view ID '/registration/personal-details.xhtml' for outcome 'registration'
where/registration/personal-details.xhtml
是当前文件名,registration
是当前 Flow Scope 的名称。
我在菜单中呈现的链接也呈现为:
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
不存在,但我想我可以通过更改<start-node>
config.xml 来覆盖默认文件名。
有没有办法让我的文件结构保持非默认值并让它工作?究竟是什么问题?