I was trying to make my APP work with Spring and JSF. And make spring take care of the ManagedBean lifecycle.
But as the cool guys from this forum said, I decided to leave that to JSF and use Spring only for other type of beans.
But now, my viewScoped bean gets its viewExpired and nothing works on it. If I change the ManagedBean to "SessionScoped" than every thing
works like a charm.
NOTE: I tested in both JSF implementations! Both throws the same exception!
So, I´ll show you guys the config files:
Ok... Now I´ll show you the "header" of my ManagedBean.
Just some explanation.. I Have a abstract class representing all methods and stuff.. But, you guys already noticed that! lol
Since I need a default constructor ... I use postConstruct annotation to set the content of the parent class.
Well, I don´t think I need to show you guys the view (xhtml). The first motive is that I created alot of composite components,
so, the 'dirty' code are all encapsulated.
I think I mentioned this already, but a JSF backing bean isn't a Controller, It's a Model.
Your use of a DynaForm does tend to muddy a lot of things, though, and it's one reason I haven't been able to give more useful answers.
Views should expire any faster in View Scope than in Session Scope. For one thing, I'm virtually certain that View Scope is simply a Session Scope that cleans up after itself.
My suspicion is that you're referencing the View after the View has been initially departed. I would be unsurprised to learn that you've bound the Dynaform to that view and are attempting to employ it after its context has been destroyed by the View Scope clean-up services.
These are just guesses, however. I'm afraid that when I get hit with large code samples this early in the morning, my response is to fall back in my chair and drool.
An IDE is no substitute for an Intelligent Developer.
Joined: Oct 30, 2012
I fixed the problem!!
I can´t believe it was just this:
and ViewScoped started to work again!
I found a person that made a framework that was the 2 scopes I needed!
It is "AccessScope".. The managedBean keeps alive if the next page has references to it.
And its working great!! I talked to the person who did it . He said it is a "spring bean" he created
using orchestra conversation scope.. Something like that. I cant give more information because I lack! lol