Auto-cast Spring Beans
问题 Is there a way to auto-cast Spring beans to the class defined in the application context XML? I'd like to avoid putting type information about the beans in 2 places.... in the xml configuration file and also in the code as a cast. For instance, given this config file <bean id="bean-name" class="SimpleSpringBean" scope="prototype"> <property name="myValue" value="simple value"></property> </bean> Can I call ApplicationContext.getBean("bean-name") in such a way as to avoid directly casting the