01 di kulai - Google Blog Search |
Paul <b>Labis</b>: Embedded Jetty in Spring MVC, IoC/<b>DI</b> Posted: 26 May 2010 09:41 AM PDT I was trying to configure embedded jetty in a spring application that implements MVC(Model View Controller). I want to utilize single spring applicationContext xml file for IoC(Inversion of Control) and DI(Dependency Injection) on dispatcher servlets. The goal is to be able to use or reference beans configured/located on already been loaded spring application context. Read and understand my resolution below. This is what my main method look like: LOG.info("Application starting"); The idea is that DispatcherServlet's context is child context of GenericWebApplicationContext which in turn is a child of ClassPathXmlApplicationContext. Explicitly invoking setParent() gives you the access to all beans from the web application context. Hope this helps. Feel free to leave your comment or suggestions. |
You are subscribed to email updates from di labis - Google Blog Search To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google Inc., 20 West Kinzie, Chicago IL USA 60610 |
Tiada ulasan:
Catat Ulasan