Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-3376

ServletContext should be available to modules during startup

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • None
    • modulemechanism
    • None

      Currently the ServletContext is not available to modules during startup. This is for instance a problem in integration scenarios where the module starts a framework such as Spring. In blossom this has been solved by adding an extra context listener. A cleaner solution would be to make it available in standard magnolia.

      Modules are started using SystemContext. Set in ConfigLoader.load() or ModuleManagerWebUI.execute().

      If we add getServletContext() to SystemContext it still has to be taken from somewhere. The implementation we use for SystemContext is configured in mgnl-beans.properties and created by Components. The implementation would have to look for it somewhere, probably a static field.

      If we had a DI container in place then ServletContext could have been one of the injectible types and the problem would be solved.

        Acceptance criteria

              tmattsson Tobias Mattsson
              tmattsson Tobias Mattsson
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Task DoD