1、创建object.xml文件
2、写入xml文件的代码:
<?xml version="1.0" encoding="utf-8" ?> <objects xmlns="http://www.springframework.net" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.net http://www.springframework.net/xsd/spring-objects.xsd"> <object name="PersonDao" type="TSpring.MyDao.PersonDao, TSpring.MyDao"> </object> </objects>
*****3、将object.xml文件属性“生成操作”设置为:嵌入的资源
第三步非常重要,如果不变更文件的属性,会在运行时报错:Error creating context 'spring.root'
本文详细介绍如何使用Spring框架创建和配置XML文件,包括object.xml文件的建立、XML代码的编写及属性设置,确保Spring上下文正确加载。
1226

被折叠的 条评论
为什么被折叠?



