MyFaces Core
  1. MyFaces Core
  2. MYFACES-1689

Reload of faces-config-files if changes are detected

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.1.6-SNAPSHOT
    • Fix Version/s: 1.1.6
    • Component/s: General
    • Labels:
      None

      Description

      This will check regularly for changes in the web.xml file, and reloads it if needed. The time interval can be set by means of a context parameter (default is 2 seconds right now).

        Activity

        Hide
        Sorin Silaghi added a comment -

        here is the patch file

        Show
        Sorin Silaghi added a comment - here is the patch file
        Hide
        Martin Marinschek added a comment -

        Hi Sorin,

        very nice, but the faces-config.xml file reload is missing. Actually, the faces-config.xml file is the important one - cause the web.xml will mostly be read by the servlet-container, and we can't tell the servlet-container to reload its definitions. The only thing where a web.xml reload might help is for the context-parameters - but that would mean some additional handling inside MyFacesConfig, I guess, or the ServletExternalContextImpl.

        regards,

        Martin

        Show
        Martin Marinschek added a comment - Hi Sorin, very nice, but the faces-config.xml file reload is missing. Actually, the faces-config.xml file is the important one - cause the web.xml will mostly be read by the servlet-container, and we can't tell the servlet-container to reload its definitions. The only thing where a web.xml reload might help is for the context-parameters - but that would mean some additional handling inside MyFacesConfig, I guess, or the ServletExternalContextImpl. regards, Martin
        Hide
        Sorin Silaghi added a comment -

        new patch to fully refresh faces configuration (it includes the changes of last patch)

        Show
        Sorin Silaghi added a comment - new patch to fully refresh faces configuration (it includes the changes of last patch)
        Hide
        Martin Marinschek added a comment -

        This looks very good now - one thing is still missing, though, I think:

        The old configuration is not cleaned out - so if you have a phase-listener configured, e.g., you'll have after 10 reloads 10 active phase-listeners, unless I understand something wrongly here.

        regards,

        Martin

        Show
        Martin Marinschek added a comment - This looks very good now - one thing is still missing, though, I think: The old configuration is not cleaned out - so if you have a phase-listener configured, e.g., you'll have after 10 reloads 10 active phase-listeners, unless I understand something wrongly here. regards, Martin
        Hide
        Sorin Silaghi added a comment -

        this is the latest version.. I had a few bugs in it but it should now clear the whole configuration and reloaded if it detects changes in the files....

        Show
        Sorin Silaghi added a comment - this is the latest version.. I had a few bugs in it but it should now clear the whole configuration and reloaded if it detects changes in the files....
        Hide
        Martin Marinschek added a comment -

        Brilliant! I really love the results, plus played around a bit more - I'm using less static methods now (we could still clean this up a bit more, whenever someone gets time, plus also think about when/where synchronization might be necessary), and I also made sure that beans which are not there anymore are actually removed from session and application scope.

        In any case, good work, Sorin - I love the effect for development - it will give us all a productivity boost.

        regards,

        Martin

        Show
        Martin Marinschek added a comment - Brilliant! I really love the results, plus played around a bit more - I'm using less static methods now (we could still clean this up a bit more, whenever someone gets time, plus also think about when/where synchronization might be necessary), and I also made sure that beans which are not there anymore are actually removed from session and application scope. In any case, good work, Sorin - I love the effect for development - it will give us all a productivity boost. regards, Martin
        Hide
        Martin Marinschek added a comment -

        Sorin,

        can you do me one favor - can you checkout the MyFaces 1.2 sources, and recreate this patch for these sources as well?

        regards,

        Martin

        Show
        Martin Marinschek added a comment - Sorin, can you do me one favor - can you checkout the MyFaces 1.2 sources, and recreate this patch for these sources as well? regards, Martin
        Hide
        Martin Marinschek added a comment -

        Also committed for 1.2 now.

        regards,

        Martin

        Show
        Martin Marinschek added a comment - Also committed for 1.2 now. regards, Martin

          People

          • Assignee:
            Martin Marinschek
            Reporter:
            Sorin Silaghi
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development