临时谈话结束疑虑
我最近一直在与 Seam 合作,临时对话仍然让我感到困惑。
在我们的项目中,我们使用 ExternalContext.redirect()
将用户重定向到响应页面。据我所知,当调用渲染响应阶段时,Seam 对话就会结束。
但后来我在其他地方读到: Seam 在 JSF 回发和重定向之间透明地传播对话上下文(包括临时对话上下文)。
因此,当我重定向到同一页面时,commandLinks 的操作 url 总是附加相同的对话 ID。我尝试用
结束临时对话,如页面所示,但这会导致重定向页面渲染后,对话上下文已经是 fred 并且我们使用的 bean 不能再在响应中使用。
所以我想知道的是,是否有一种方法可以通过重定向结束对话并保留上下文直到渲染响应?
如果不是,临时谈话什么时候真正结束?因为由于对话上下文是通过重定向和回发传播的,所以对我来说它永远不会结束。
I've been working with Seam recently and temporary conversations still confuse me.
In our project we're using ExternalContext.redirect()
to redirect the user to the response page. From what I've read, a Seam conversation ends when the render response phase is called.
But then I read somewhere else that: Seam transparently propagates the conversation context (including the temporary conversation context) across JSF postbacks and redirects.
So what happens when I redirect to the same page is that commandLinks have the same conversationId appended to its action url always. I've tried to end the temp conversation with <f:param name="conversationPropagation" value="none"/>
, as the page says, but that causes that when the redirected page is rendered, the conversation context is already fred and a bean we where using can't be no longer used in the response.
So what I want to know, is that if there's a way to end the conversation with a redirect and mantain the context until the rendering of the response?
If not, when does a temp conversation really end? Because since the conversation context is propagated through redirects and postbacks, then it seams to me it will never end.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为 CONVERSATION 范围是由 SEAM Frame 工作抛出 UI 自动维护的,如果您想创建一个新的对话,那么您可以这样做。
我不确定,但如果你想结束对话,那么你可以这样尝试。
我不确定它是否有效。
I thing CONVERSATION scope is automatic maintain by a SEAM Frame work throw UI if you want to create a new conversation then you can do like this.
i am not sure but if you want to close a CONVERSATION then you can try like this.
i am not sure it will work or not.