ClassPathXmlApplicationContext 工
2025-07-05 本文已影响0人
zzz_0427
applicationContext.xml
<beans>
<bean id="user" class="com.xxx.entity">
</bean>
</beans>
ApplicationContext ac = new ClassPathXmlApplication("classPath:/applicationContext.xml")
User user = (User)ac.getBean("user");