Uploaded image for project: 'Hippo CMS'
  1. Hippo CMS
  2. CMS-12905

Support setting the root spring app context as parent of the HST spring context

    XMLWordPrintable

Details

    • Improvement
    • Status: Open
    • Normal
    • Resolution: Unresolved
    • None
    • None
    • site-toolkit
    • None

    Description

      I think it's a good idea to be able to set the root Spring application context as the parent of the default context that HST creates and uses. 

      A use case for this is for example when using Spring security and you want to access say a UserManager bean in your HST components, which is a bean defined in the root context. It would be nice to have access to that and I think it's trivial:

      • Add a conf property 'component.inherit.root.web.application.context' = true (false by default)
      • Modify org.hippoecm.hst.site.container.SpringComponentManager#initialize to use the 3 argument constructor of DefaultComponentManagerApplicationContext (org.hippoecm.hst.site.container.DefaultComponentManagerApplicationContext(ComponentManager componentManager, ContainerConfiguration containerConfiguration, ApplicationContext parentApplicationContext)), allowing the WebApplicationContext be the parent of HST ComponentManager, if the option is set to true.

      wdyt?

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mchatzidakis Minos Chatzidakis
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: