I am using Spring MVC for my web application. My beans are written in \"spring-servlet.xml\" file
spring-servlet.xml
Now I have a class MyClass and i want to
MyClass
If you're implementing a class that's not instantiated by Spring, like a JsonDeserializer you can use:
WebApplicationContext context = ContextLoader.getCurrentWebApplicationContext(); MyClass myBean = context.getBean(MyClass.class);