正在加载图片...
Web Technology Bean Factory Example public class Test i public static void main(string[] args)( BeanFactory factory new XmlBeanFactory new ClassPathResource("/Beans. xml")) HelloApp helloApp =(HelloApp) factory. getBean("helloApp")i helloApp display producedMessage o)i Now using this style more Application Context context =new File SystemXmlApplication Context( application Context. xml); Greeting greeting =(Greeting) context. getBean("Greeting");Web Technology 14 Bean Factory Example public class Test { public static void main(String[] args) { BeanFactory factory = new XmlBeanFactory( new ClassPathResource("/Beans.xml")); HelloApp helloApp = (HelloApp) factory.getBean("helloApp"); helloApp.displayProducedMessage(); } } ApplicationContext context = new FileSystemXmlApplicationContext("applicationContext.xml"); Greeting greeting = (Greeting) context.getBean("Greeting"); Now using this style more
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有