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

        Sorin Silaghi created issue -
        Hide
        Sorin Silaghi added a comment -

        here is the patch file

        Show
        Sorin Silaghi added a comment - here is the patch file
        Sorin Silaghi made changes -
        Field Original Value New Value
        Attachment web_xml_reload.patch [ 12362701 ]
        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
        Sorin Silaghi made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        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)
        Sorin Silaghi made changes -
        Attachment faces-configuration-refresh.patch [ 12362859 ]
        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....
        Sorin Silaghi made changes -
        Attachment faces-configuration-refresh-0.9.patch [ 12362967 ]
        Martin Marinschek made changes -
        Attachment faces-configuration-refresh.patch [ 12362859 ]
        Martin Marinschek made changes -
        Attachment web_xml_reload.patch [ 12362701 ]
        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
        Martin Marinschek made changes -
        Priority Minor [ 4 ] Critical [ 2 ]
        Summary Reload of web.xml file if changes are detected Reload of faces-config-files if changes are detected
        Martin Marinschek made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Fix Version/s  1.1.6-SNAPSHOT [ 12312311 ]
        Resolution Fixed [ 1 ]
        Assignee Martin Marinschek [ mmarinschek ]
        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
        Leonardo Uribe made changes -
        Fix Version/s 1.1.6 [ 12312312 ]
        Fix Version/s  1.1.6-SNAPSHOT [ 12312311 ]
        Leonardo Uribe made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Patch Available Patch Available
        3d 12h 19m 1 Sorin Silaghi 31/Jul/07 08:17
        Patch Available Patch Available Resolved Resolved
        1d 14h 58m 1 Martin Marinschek 01/Aug/07 23:16
        Resolved Resolved Closed Closed
        381d 1h 27m 1 Leonardo Uribe 17/Aug/08 00:43

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development