Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-2785

Clean up initialization code and add tests for StartupServletContextListener and MyFacesServlet

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.1-SNAPSHOT
    • 2.0.1
    • JSR-314
    • None

    Description

      Some major code clean up on the initialization of MyFaces:

      • The solution for startup and shutdown FacesContext implementations (MYFACES-2730) introduced some duplicate code on StartupFacesContextImpl and FacesContextImpl. This can be solved by providing a base implementation class (like the one in for StartupExternalContext). This will make maintaining the two FacesContext implementation very easy, because there are no duplicate methods (except for getViewRoot() on StartupFacesContextImpl).
      • JUnit tests are needed to verify the behavior of StartupServletContextListener and MyFacesServlet and to check if the FacesContext is available on startup and shutdown
      • AbstractFacesInitializer should provide a static method to get the right FacesInitializer impl instead of having several duplicate methods in StartupServletContextListener and MyFacesServlet that do nothing but getting the right impl and invoking some method on it.
      • AbstractFacesInitializer.dispatchInitDestroyEvent should use the application object from the StartupFacesContextImpl and not directly from the factory
      • AbstractFacesInitializer.getLifecycleId() is unused because of MYFACES-2730
      • initStartupFacesContext() and initShutdownFacesContext() should set the field startup correctly (true or false) and should not create the UIViewRoot directly (it should be created in StartupFacesContextImpl at first access)
      • minor javadoc copy and paste error on FacesInitializer

      Attachments

        1. MYFACES-2785.patch
          77 kB
          Jakob Korherr
        2. MYFACES-2785-2.patch
          80 kB
          Jakob Korherr

        Activity

          People

            jakobkorherr Jakob Korherr
            jakobkorherr Jakob Korherr
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: