我用MyEclipse6.0spring 配置文件的doctype,beans 到底怎么配置才不会提示报错?我一开始配置:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"><beans></bean>
这样我的程序不会提示报错,也正常的运行.
但是我新加几个标签,就会提示有错误,不符合验证...我看许多的人的配置是这样的:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
</beans>可是我这样配置的话,原来的配置都验证不过去了.
到底该怎么配置MyEclipse的验证和spring配置文件啊?请教问题:
1:MyEclipse应该怎么配置验证,是根据什么验证的spring配置文件?
2:spring配置文件应该怎么配置.不同的版本应该是不一样的?根据spring.jar里么?
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"><beans></bean>
这样我的程序不会提示报错,也正常的运行.
但是我新加几个标签,就会提示有错误,不符合验证...我看许多的人的配置是这样的:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
</beans>可是我这样配置的话,原来的配置都验证不过去了.
到底该怎么配置MyEclipse的验证和spring配置文件啊?请教问题:
1:MyEclipse应该怎么配置验证,是根据什么验证的spring配置文件?
2:spring配置文件应该怎么配置.不同的版本应该是不一样的?根据spring.jar里么?
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>
上面的一个还是用的dtd
应该是比较老的版本吧
你怎么配置要看你用的spring的jar包的版本
可是我的版本对应上,MyEclipse还是报错啊..
能深入点说说么.我想知道是怎么来滴,不是怎么copy滴..