Wicket
  1. Wicket
  2. WICKET-5079

Allow WebApplication-specific Spring configuration

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 6.6.0
    • Fix Version/s: 6.7.0
    • Component/s: wicket-spring
    • Labels:
      None

      Description

      SpringWebApplicationFactory allows two places to defined a WebApplication:

      • in the global root application context loaded by Spring's ContextLoaderListener
      • in a filter-specific additional web applcation context.

      SpringComponentInjector is not aware of this additional context but just uses the global one. This imposes the following restrictions:

      • the filter-specific context cannot define any beans to be used by SpringComponentInjector
      • SpringComponentInjector cannot work without a global root application, i.e.ContextLoaderListener is required.

      Starting with Wicket 6.7.0 the filter-specific context is made accessible to SpringComponentInjector. If no application context is given explicitly to SpringComponentInjector's constructor, by default the injector uses the application context used to create the WebApplication.

      Benefits:

      • no need to define ContextLoaderListener in web.xml (i.e. less xml)
      • use application-specific beans defined in the filter-specific application context

        Activity

        Sven Meier created issue -
        Sven Meier made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Martin Grigorov made changes -
        Fix Version/s 6.7.0 [ 12323964 ]
        Sven Meier made changes -
        Summary Improve Spring application context handling Allow WebApplication-specific Spring configuration
        Description Handling of Spring application contexts could be improved:
        - to allow working without a root application context
        - to allow SpringComponentInjector to inject beans from the filter/application-specific web application context
        SpringWebApplicationFactory allows two places to defined a WebApplication:
        - in the global root application context loaded by Spring's ContextLoaderListener
        - in a filter-specific additional web applcation context.

        SpringComponentInjector is not aware of this additional context but just uses the global one. This imposes the following restrictions:
        - the filter-specific context cannot define any beans to be used by SpringComponentInjector
        - SpringComponentInjector cannot work without a global root application, i.e.ContextLoaderListener is required.

        Starting with Wicket 6.7.0 the filter-specific context is made accessible to SpringComponentInjector. If no application context is given explicitly to SpringComponentInjector's constructor, by default the injector uses the application context used to create the WebApplication.

        Benefits:
        - no need to define ContextLoaderListener in web.xml (i.e. less xml)
        - use application-specific beans defined in the filter-specific application context

          People

          • Assignee:
            Sven Meier
            Reporter:
            Sven Meier
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development