PS:在“三HelloApp.java”中,有BeanFactory factory=new XmlBeanFactory((Resource) new FileInputStream("hello.xml"));这么一句,其中(Resource)这个书上是没有的,不过我按书上的代码写的时候,eclipse报错:
the constructor XmlBeanFactory(FileInputStream) is undefined
然后我就点击小红叉,按eclipse的提示加上了(Resource),我用的是myeclipse4.1,然后建立纯java工程,把spring导入工程,书上只说下载最新的spring,不知道会不会和我的myeclipse的版本有关。
我的代码绝对正确,没有错误,只有(Resource)和书上不同,请各位大侠帮帮小弟,谢谢了~!