Uploaded image for project: 'DeltaSpike'
  1. DeltaSpike
  2. DELTASPIKE-1202

WindowContext not active during JSF event propagation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Reopened
    • Minor
    • Resolution: Unresolved
    • 1.7.1
    • None
    • JSF22-Module
    • None

    Description

      While trying to implement some lifecycle event listeners for performance measurement, I had a hard to to figure out, why some of my listeners do not get invoked at all. Specifically

      @WindowScoped
      public class PerformanceListener implements Serializable {
      
          void onFacesContextInitialized(@Observes @Initialized FacesContext context) {
              System.out.println("Context active: " + context);
          }
      }
      

      does not get fired, because the WindowContext is not active. Even though to some ContextNotActiveException beeing thrown, latest stable Weld catches these exceptions and do not invoke the listener at all.

      As window handling is performed via DS using the default config, I thought the window is active when FacesContext is created.

      According to DeltaSpikeLifecycleWrapper#execute the WindowContext gets activated after @Initialized FacesContext event being thrown. Is there a reason for that behavior, because the current implementation will restrict all ClientWindow-based scoped beans to receive only @Destroyed FacesContext, but not @Initialized FacesContext events. From my humble point of view, the WindowContext could/should be activated, when Lifecycle#attachWindow is called.

      Attachments

        Activity

          People

            gpetracek Gerhard Petracek
            tzwoenn Sven Linstaedt
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: