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

  • Web.xml

    Say i initialize the spring IOC container in web.xml as follows..
    some files

    So now exactly what does this give me? How can i get a reference to any of the objects in the container? How can i get the factory to make retrieve the beans?

    I see you can kind of use the contextsingletonbeanfactory in this fashion..
    BeanFactoryLocator bfLocator = ContextSingletonBeanFactoryLocator.getInstance();
    BeanFactoryReference bfReference = bfLocator.useBeanFactory("examples.spring");
    BeanFactory factory = bfReference.getFactory();
    Object o = factory.getBean("whatever")

    But that still requires me to create a managed bean in some .xml file with the id of "examples.spring" that has all of the configuration files. But why do i duplicate the name of the .xml files to use.. once in this .xml file and once in web.xml?

    What are the benifets of initializing the IOC container in web.xml if i just have to use initialize it programatacilly to do anything with it.

  • #2
    This might be useful.