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.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…