Announcement Announcement Module
No announcement yet.
Where to place Application Context Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Where to place Application Context


    I'm developing an J2EE Application which will use by web clients standalone clients which will be located on different virtual maschines. The remoting will (for various reasons) be done by EJBs, using some of the spring tools as far as apropriate.

    On the service tier, I'm planning to use POJOs via Spring, for all business logic which cannot be accessed via remote calls. On the client tier I'm still asking, if I need Spring at all. Now I'm wondering where I should set up the application context on the BusinessTier. In case of a single virtual maschen I can setup an XMLWebApplicationContext, which I can initialize via servlet. But how can I create an ApplicationContext on the BusinessTier and where should I store it?


  • #2
    You may place your application context file anywhere in your ejb-jar file. I usually place it in the root. When using the provided helper classes (as described here you can then specify the path to it in your ejb-jar.xml file (relative to ejb-jar root).

    As for the client. In my opinion the convenience access to EJBs provided by Spring is really worthwile.



    • #3
      How do I load the applicationContexts?

      Could you write down a piece of code which could actually load the application contexts in the EJB-jar.
      I dont have war in my ear. How can I load them with out web.xml?


      • #4
        See the doco

        There are some code snippets in the reference docs:

        If you don't want to load an ApplicationContext for every single EJB (and you probably don't), you should read up on ContextSingletonBeanFactoryLocator like it says.