Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-2572

Add capability for SpringWebApplicationFactory to create its own application context

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.4.3, 1.5-M1
    • 1.4.4, 1.5-M1
    • wicket-spring
    • None

    Description

      The current SpringWebApplicationFactory is only capable of using the root WebApplicationContext to fetch the WebApplication object. In cases where there's only one Wicket application per webapp, this is fine, but sometimes you want more than one, and you want them in seperate contexts.

      This is analogous to using multiple Spring DispatcherServlets in a single webapp - each servlet gets its own context, and optionally share the same root WebApplicationContext as their parent.

      I propose an enhancement to SpringWebApplicationFactory allowing it to create a new application context, and to retrieve the WebApplication object from there.

      The WebApplication object itself can then have itself autowired with the application context from which it was fetched. This application context can then be fed into SpringComponentInjector's constructor, so there's no need for SpringComponentInjector to know how to look up this newly-created context.

      Patch to follow.

      Attachments

        1. SpringWebApplicationFactory.java
          6 kB
          Kenny MacLeod
        2. SpringWebApplicationFactory.patch
          4 kB
          Kenny MacLeod

        Activity

          People

            ivaynberg Igor Vaynberg
            skaffman Kenny MacLeod
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: