On 9/22/06, emily chen <[EMAIL PROTECTED]> wrote:
Hi there, I think there is a bug in Shale framework 1.0.4-SNAPSHOT( shale-framework-20060917.zip). in the init() function of TestVC that extends AbstractViewController, if we get the HTTPServeltRequest object from ExternalContext, then try to add a new attribute ( an instance of TestVC) to the request object. The TestVC is created, then destroyed, recreated, destroyed, recreated, destroyed.....
Just out of curiousity, why are you adding an instance of TestVC as a request attribute, when it is already there (because its a managed bean and JSF created it for you)? The reason this is relevant is that the underlying mechanism that fires ViewController lifecycle events is now a ServletRequestAttributeListener (was not the case in 1.0.1, but there were many other bugs the way it used to be handled). That means the callback methods are fired as soon as a request attribute is added. If you add this same instance under some other key, the callback methods will be fired again. If you re-add it under the same key the previous registered instance will be destroyed, then the new instance (happens to be the same bean) init'd again -- exactly as you are seeing. Craig