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
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.
Declare the parameters which you'd like to set or pass through to the next view in a
<f:metadata>
<f:viewParam name="foo" value="#{bean.foo}" />
</f:metadata>
This does basically bean.setFoo(request.getParameter("foo"))
during update model values phase of the GET request.
If you add includeViewParams=true
parameter to the navigation outcome, then the ones which are declared as <f:viewParam>
of the current view will be passed through to the next view.
public String doSomething() {
// ...
return "next?faces-redirect=true&includeViewParams=true";
}
(note: the &
is important! the &
won't work as it's not XML-valid)
The next view should have the same <f:viewParam>
to get them to set in the bean. And so on.