0Spring配置基础——xml文件代码提示

先看这个xml文件


先看这个xml文件

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">


</beans>

这个xml没有设置任何的bean。先解释一下:
xmlns 是xml namespace,使用beans也就是IOC就需要引入这个命名空间 http://www.springframework.org/schema/beans。

xsi最后指向了一个网络上的位置
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
xml的代码提示就是从这个xsd上读取的。那么我们要把这个读取放到本地,代码提示功能会快一些。


Preference-xml-xml catalog在user specified entities上点add按钮

[img]http://dl2.iteye.com/upload/attachment/0100/5498/a507a96b-d094-310c-a663-d59cdf191570.png[/img]


1、location选file system 选中spring文件夹中的spring-beans-2.5.xsd文件
2、key type选Schema location
3、key填写http://www.springframework.org/schema/beans/spring-beans-2.5.xsd保持跟xml中一致。
4、点ok

[img]http://dl2.iteye.com/upload/attachment/0100/5500/96667904-b7f1-39b2-9097-4ea6535491df.png[/img]

这样xml代码提示的时候会跳转到本地磁盘上的xsd文件。比网络快多了,也爽多了
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值