spring配置文件求解

万物皆字节 2012-12-30 01:30:48
平常用到spring时把它的配置文件copy过来就是了,但是最近看看里面的一些代码,有的还不是太明白,请高手们指导指导。
xmlns=" http://www.springframework.org/schema/beans"
xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
xmlns:context=" http://www.springframework.org/schema/context"
xmlns:aop=" http://www.springframework.org/schema/aop"
xmlns:tx=" http://www.springframework.org/schema/tx"
xmlns:mvc=" http://www.springframework.org/schema/mvc"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd"



命名空间到底产生什么作用呢?

后面的schema是不是电脑不联网就不受约束了?还是这些文件已经存在eclipse的某个文件夹里了?因为点击ctrl和左键时能够看到文件内容。

还有配置xml catalog时的具体选项是什么样的呢?是选public id还是Url呢?
...全文
168 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
swoky 2012-12-31
  • 打赏
  • 举报
回复
相信很多人都没去想过这个问题,现在仔细去看spring文档的人少了 很多文档都有说的: http://static.springsource.org/spring/docs/3.1.x/spring-framework-reference/html/extensible-xml.html#extensible-xml-registration
  • 打赏
  • 举报
回复
相当于导入标签库,跟连网没有联系。
suciver 2012-12-31
  • 打赏
  • 举报
回复
命名空间就是等于你在用到这些设置时的标签的前缀名称。例如你的事务管理器声明的命名空间的前缀是tx那么在使用这些关于事务管理器声明的时候就要tx:开头了这个类似于jsp上使用标签库时定义的prefix一样。 这个schema就是约束这些标签的使用规范,相当于jsp标签库上的uri。在配置public id的时候id只是在IDE工具里的一个标识,具体的还是uri路径即schema文档路径,所以public id是不可重复的,uri则可以。
qh8569 2012-12-31
  • 打赏
  • 举报
回复
这个我也不会,看不明白。
万物皆字节 2012-12-31
  • 打赏
  • 举报
回复

67,512

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧