Announcement Announcement Module
No announcement yet.
Using applicationContext.xml from jar Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using applicationContext.xml from jar

    In my project I want to have a core module (with all services, daos, hibernate mappings, etc) and several front-ends (a web front-end, REST, maybe even a scala REPL front-end for administration).

    In my web front-end I want to continue to use Spring for all Spring goodness, and I need to access the services made available from the core module.

    So my question is: Should I name the core's main application context file something like applicationContext-core.xml and then import that from the web module's applicationContext.xml? Or should I use some other type of configuration?

    I also wanted to see if I'm going down the wrong road here with this idea, and if there are any suggestions/improvements..

    Thanks in advance,

  • #2
    Refer the spring doc, you'll get the answer.
    Use "Classpath:applicationContext*" or might be little bit diffrent but using this one you can refer the applicationContext file from your class path.


    • #3
      Load your unique core application context using listener that points to the same file in all web.xmls of all the application. Then, for each distinct application, load its web context through servlet. This way, all your separate web contexts will have access to the core application context, as they will be children of that context.