Announcement Announcement Module
No announcement yet.
Creating a WebApplicationContext from an ApplicationContext Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Creating a WebApplicationContext from an ApplicationContext

    Hi all,

    I'm trying to create a framework of sorts, whereby a developer can extend a superclass, declare the configuration files that make up the ApplicationContext, and the framework will boot Jetty and load up Spring and a JX-RS provider (in this case RESTeasy). I'm doing all this programatically without configuration of a web.xml.

    I create a WebApplicationContext from the supplied config files and register a ContextLoaderListener with Jetty which takes this WebApplicationContext as a constructor. It works and hopefully isn't a crazy way of doing things (please comment if it is).

    For testing I'm trying to see if I can get any caching help from the Spring Test Framework, such that rather than passing the config classes themselves to the framework, I can pass the cached ApplicationContext directly.

    My question is, assuming the above is sane, how would you register a ContextLoaderListener given you already have an ApplicationContext?

    Many thanks!