spring 引入不了p标签
答案:3 悬赏:60 手机版
解决时间 2021-04-03 21:17
- 提问者网友:雪舞兮
- 2021-04-03 11:11
spring 引入不了p标签
最佳答案
- 五星知识达人网友:撞了怀
- 2021-04-03 11:40
p标签存在于内核中,不需要schema定义,定义格式如下:
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">报错的原因可能是
你电脑没网,eclipse会自动根据url下载对应的xsd文件来检验xml的格式
eclipse误报,关了xml文件,重新打开
spring版本不支持p标签
追问其他的没报红说明有网,我用的也不是eclipse, 我用的是spring4.0.1这个不支持么, 还有我没有看懂你的代码, 我的是在spring配置文件里写的
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">报错的原因可能是
你电脑没网,eclipse会自动根据url下载对应的xsd文件来检验xml的格式
eclipse误报,关了xml文件,重新打开
spring版本不支持p标签
追问其他的没报红说明有网,我用的也不是eclipse, 我用的是spring4.0.1这个不支持么, 还有我没有看懂你的代码, 我的是在spring配置文件里写的
全部回答
- 1楼网友:杯酒困英雄
- 2021-04-03 13:01
我也遇到这个问题了, 你解决了吗?
我找到答案了
复制出现红色字体的路径。。。
File - Settings - schemas and DtDs
点击加号。把路径考进去就可以了
- 2楼网友:佘樂
- 2021-04-03 12:34
如果你的xml文件中使用beans标签构造参数注入
你必须把bean标签放在beans标签之前 (即使你引用了xmlns....p)
改变位置之后就没问题了
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯