java - Spring get current ApplicationContext -
I'm using Spring MVC for my web application my beans " Now I have a class I have written the following in Now let me get this so that I can How to do this ?? Just inject it. Or apply this interface: spring-servlet.xml "The file is written
MyClass and I want to use this class using Spring Beans
spring-servlet.xml
bean id = "miracles" category = "comm. MyClass" />
ApplicationContext
ApplicationContext context = ?? I need to use
MyClass myClass = (MyClass) context.getBean ("myClass");
@Autowired Private ApplicationContext appContext;
Comments
Post a Comment