I'm quite new to Spring so sorry for the stupid question. For test purposes i've initialized by beans in the following way:
public static void main(String[] args) {
And that would work fine, but when it comes to the bigger application what is the correct way to access context object? Do I have to create singleton for that purpose?Code:ApplicationContext context = new ClassPathXmlApplicationContext("context.xml"); Foo f = (Foo) context.getBean("foo"); f.start(); }


Reply With Quote