Ilari Moilanen wrote:#{loginUser} is a simple managed bean (related to custom login procedure) as I stated above. But when I did some rechecks on this problem now I realized that the actual problem is not only the @ViewScoped bean.
When I check the presence of loginUser normally then it is present no matter if the calling bean is @RequestScoped, @SessionScoped or @ViewScoped. But when I use AJAX call (with f:ajax) then the loginUser is not present if the calling bean is @ViewScoped. This looks like a bug in the implementation of @ViewScoped. And the bug may be only present in the implementation that I use (MyFaces 2.0.1 and 2.0.2).
I may check if the behavior is changed when using the Mojarra implementation...
EDIT: I tested it and for some reason I can not get Mojarra implementation (2.0.1) do the ajax call at all. I do not have time to find what the reason is so this problem remains unresolved.
EDIT2: Argh, tested this with Mojarra 2.0.3 and the ajax call worked but the loginUser remains as null (although it is in the session). So this may be intended for some reason. Can not understand what the reason might be but nevertheless...