I have a big java project that contains many servlets. and each servlet needs to get objects from the same bean file using the following command:
ApplicationContext context = new ClassPathXmlApplicationContext("beans.xml");
and then I use
context.getBean("<BEAN_NAME">);
some of them even needs to get same objects.
the question is if it's possible to inject the object that I want directly to the servlets without reading the bean file manually.
each servlet is configured in web.xml.
any information regarding the issue would be greatly appreciated!
thanks