JSF / Mojarra“闪光范围”问题 [英] JSF/Mojarra "flash scope" problems

查看:96
本文介绍了JSF / Mojarra“闪光范围”问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序运行在Mojarra 2.1.1 / Glassfish 3.1上,现在已经增长到150,000多b $ b行代码。该应用程序广泛使用ajax与ViewScoped托管的bean和
page-redirect-get模式(即faces-redirect = true)。

有一件事是不断的令人讨厌的是,页面之间传递
参数的明显缺乏方便性,以及bean到bean(每个页面都有它自己的支持bean)。



I无法使闪光灯工作。我通常需要访问写入到下一页的preRenderView事件侦听器中的闪存中的数据b
。这不是
可靠工作,特别是在重新部署应用程序后。



我已经阅读过CDI,并花了几天的时间尝试从JSF托管bean
到CDI bean,但无法让它工作。 Seam 3和Glassfish 3.1之间似乎存在很多兼容性问题
。我将Weld升级到了1.1.1,但这没有帮助。从
我的观点来看,目前它不起作用。当我说不起作用,例如
我有一个页面试图将h:inputText转换为支持bean中的字符串,并且
不工作,非常简单。



由于我遇到的CDI问题,我不能使用seam-faces @RenderScoped,它在
a非常简单的测试应用程序(甚至在g / f 3.1上)只是做了什么我想,但不是在
复杂的主应用程序中。



目前唯一可以使用的可靠机制是URL参数,它们是
安全噩梦。尽管我们尽了最大的努力来确保数据的访问是
的正确验证,但总是会有一些东西丢失,并且看到
... xhtml?id = 51031或浏览器中的任何内容太多有些人抵制
尝试其他ID。我已经编写了一个模糊转换器来避免明文,并且
没有为名称/值对使用有意义的名称,但是这不会导致
问题的根源。



我只是想知道我是否在这里丢失了某些东西,其他人是否也有解决方案
来解决这个问题,即使在glassfish上也是如此?我担心得太多,应该坚持URL
params?其他建议?



谢谢。

解决方案

。在我尝试的时候,Seam3非常麻烦,很难将其部署到不同的服务器。我转向 MyFaces CODI ,从一开始就没有任何问题。在你的情况下,你应该看看@ViewAccessScoped。您可以摆脱所有这些烦人的解决方法。


I've got an app running on Mojarra 2.1.1 / Glassfish 3.1 which has now grown to 150,000+ lines of code. The app uses ajax extensively with ViewScoped managed beans and the page-redirect-get pattern (i.e. faces-redirect=true).

One thing that is continually annoying me is the apparent lack of ease of passing parameters from page to page, and bean to bean (every page has it's own backing bean).

I've not been able to get the flash working. I typically need to access the data I've written to the flash in the preRenderView event listener of the next page. This doesn't work reliably, particularly after an application redeployment.

I've read up on CDI and have spent a few days trying to migrate from JSF managed beans to CDI beans, but can't get it to work. There seems to be a lot of compatibility issues between Seam 3 and Glassfish 3.1. I upgraded Weld to 1.1.1 but this doesn't help. From my perspective it just doesn't work at the moment. When I say doesn't work, for example I have a page trying to h:inputText into a String in the backing bean and this doesn't work, really simple stuff.

Because of the CDI problems I'm having I can't use seam-faces @RenderScoped which in a very simple test application (even on g/f 3.1) does just what I want, but not in the complex main application.

The only reliable mechanism I can find to use at present is URL parameters which are a security nightmare. Even though every effort is made to ensure that access to data is properly authenticated there's always the change of missing something, and seeing ...xhtml?id=51031 or whatever in the browser is too much for some people to resist trying other ids. I've written an obfuscation converter to avoid clear text and don't use meaningful names for the name/value pairs, but this doesn't get to the root of the problem.

I just wondered if I was missing something here, has everyone else got a working solution to this problem, even on glassfish? Am I worrying too much and should stick with URL params? Any other suggestions?

Thanks.

解决方案

I saw the same. At the time I tried it Seam3 was very buggy and it's very hard to get it deployed to different servers. I switched to MyFaces CODI which worked without any problems from the very beginning. In your case you should have a look at @ViewAccessScoped. You can get rid of all those annoying workarounds.

这篇关于JSF / Mojarra“闪光范围”问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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