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

        Hide
        Sven Meier added a comment -

        improved context handling and added test

        Show
        Sven Meier added a comment - improved context handling and added test
        Hide
        Martin Grigorov added a comment -

        Hi Sven,

        Can you explain better what is the improvement ?
        I read the changes in the code and I cannot say that I understand what exactly is the improvement. The users will read just the info in this ticket in the best case...

        Show
        Martin Grigorov added a comment - Hi Sven, Can you explain better what is the improvement ? I read the changes in the code and I cannot say that I understand what exactly is the improvement. The users will read just the info in this ticket in the best case...

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development