@ org.omnifaces.cdi.ViewScoped在卸载已经毁坏的视图时调用@PostConstruct [英] @org.omnifaces.cdi.ViewScoped invokes @PostConstruct on unload of an already destroyed view

查看:108
本文介绍了@ org.omnifaces.cdi.ViewScoped在卸载已经毁坏的视图时调用@PostConstruct的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用 @ org.omnifaces.cdi.ViewScoped 和多个选项卡时遇到问题:

I have a problem working with @org.omnifaces.cdi.ViewScoped and multiple tabs:

我在TestPage.xhtml中有一个链接,该链接可打开另一个带有请求参数"someValue"的页面(ShowValuePage.xhtml).如果我在新选项卡中打开此链接10次并在第一个打开的选项卡中导航,则 PostConstruct将被再次调用,而不仅仅是导航.

I have a link in TestPage.xhtml that opens another page (ShowValuePage.xhtml) with a request parameter "someValue". If I open this link 10 times in a new tab and navigate away in the first opened tab, PostConstruct will be called again instead of just navigating away.

如果我多次从ShowValuePage导航到TestPage,也会发生同样的情况. (要对此进行测试,我们必须多次单击显示值"和主页"链接.)

Same happens if I navigate back from ShowValuePage to TestPage multiple times. (To test this, we must click the links "Show Value" and "Home" multiple times).

仅当打开的标签页超过了web.xml值"numberOfLogicalViews"和"numberOfViewsInSession"中定义的标签时,这种情况才会发生.

This only happens if more tabs are opened than defined in the web.xml values "numberOfLogicalViews" and "numberOfViewsInSession".

我已经建立了一个显示此问题的小项目.有关该过程的确切说明,请参见readme.txt.

I've set up a small project that shows this problem. The exact description of the procedure can be found in the readme.txt.

在github上进行项目

是否有解决方法?

感谢您和最诚挚的问候

Heinrich

PS:我将其报告为 Omnifaces上的错误,但是已经有一个星期了我没有得到答案.

PS: I reported it as a bug on Omnifaces, but since a week I didn't get an answer.

推荐答案

在OmniFaces 2.7.1和3.3中已修复.

It's fixed in OmniFaces 2.7.1 and 3.3.

这些症状是由最初在适当位置进行的显式重定向引起的,该重定向最初是为了触发任何记住最后一个受限制的请求"的身份验证框架而在会话过期时记住正确的请求.仅通过发送重定向,并且仅在会话实际上是新会话时,此问题才得到解决.

The symptoms were caused by an explicit redirect which was initially in place in order to trigger any authentication framework which remembers the "last restricted request" to remember the correct request in case the session is expired. This has been fixed by sending the redirect only and only if the session is actually new.

这篇关于@ org.omnifaces.cdi.ViewScoped在卸载已经毁坏的视图时调用@PostConstruct的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆