照着尚硅谷的的spring5敲的代码,注解注入入门敲demo的时候发现了这个保存。
解决方案:
修改spring的配置。主要是context后面要带上版本号。
<?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"
xmlns:context="http://www.springframework.org/schema/context"
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-4.2.xsd">
本文针对在使用尚硅谷的spring5教程中遇到的问题提供了解决方案,主要聚焦于spring配置文件的正确设置,包括如何添加正确的命名空间和schemaLocation,确保注解注入功能正常运行。
1370

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



