Object in Flash scope is not available after redirect

落花浮王杯 提交于 2019-11-27 15:07:25

The Mojarra's implementation of the JSF2 Flash scope had a lot of problems. Most of them were resolved with every new Mojarra release. Currently, with the latest Mojarra version, the 2.1.6, there's as far as I know still only one major open problem: it won't work if you redirect to a different base path. See also the (currently) last comment in the long discussion in issue 1751.

Right now, you have basically the following options:

  1. Forget using Flash when you need to redirect to a different base path. Use a request parameter instead or try to simulate the flash scope with a custom cookie.

  2. If possible, reorganize the folder structure so that you don't need to redirect to a different base path when you need the flash scope to survive.

  3. Try MyFaces instead of Mojarra. Maybe it does it better with regard to flash scope.


Update: as per issue 2136, the last open problem of Flash scope not being available after a redirect on a different path is solved in the shortly upcoming Mojarra 2.1.14. So with this version, all Flash scope related problems discovered and open so far should be solved and closed.

glofalcon

jsf 2.1 with netbeans has this problem with flash. using /somepage?redirect-faces=true or /somedirectory/somepage?faces-redirect=true does not work. it has to be somepage?redirect-faces=true.

tested mojarra 2.1.7, but it didn't have the above problem.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!