六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 30|回复: 0

Seam 问题集:启动对话后,转向别的页面时,显示错误的导航(Illegal navigation)

[复制链接]

升级  48%

30

主题

30

主题

30

主题

秀才

Rank: 2

积分
122
 楼主| 发表于 2013-1-23 02:48:01 | 显示全部楼层 |阅读模式
问题现象:
 
在启动对话后,比如一个页面流,在对话进行过程中,如果点击导航转向到别的无关页面,比如首页,显示错误:错误的导航(Illegal navigation)。
 
解决方案:
 
 
 
<s:linkview="/login.xhtml" value="首页"  propagation="none"/>
 
<rich:menuItemsubmitMode="ajax" value="首页"  action="#{menuapp.doHome}" >
<f:param name="conversationPropagation"value="none"/>
<rich:menuItem/>
 
<h:commandLinkaction="main" value="Exit">
    <f:paramname="conversationPropagation" value="none"/>
</h:commandLink>
 
如果需要结束对话,将 none 修改为 end
 
可参考的解释有:
 
The problem is that jPDL navigation is constrained (by contrast to JSF or Seam navigation which are free form).
So, with jPDL, the path that your users can follow is represented by afinite graph, with well defined transitions from state to state (a state being either a page or decision).
Each time the jPDL/jBPM engine detects that a user took a path that is not defined in the graph, it triggers an Illegal navigation Exception.
If you provide some kind of escape door for your users (like a cancel button, or back to menu), you should end the pageflow when the user use it. The key point is to end the conversation : that will end the pageflow as well.
According to the doc, this is done by using <end-conversation> (in your .jpdl.xml file) or by calling an @End method. AFAIK, you could use a s:link to do that. But propagation="none" will not suffice: the conversation will not be propagated thought the link, but will still be active.
 
选自: http://seamframework.org/Community/RichmenuItemAndPropagationParam
 
 
 
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表