关于spring的配置

来源:2-4 搭建项目

焰痕

2020-05-17 13:25:15

?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:context="http://www.springframework.org/schema/context"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xmlns:tx="http://www.springframework.org/schema/tx"
       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.xsd
    http://www.springframework.org/schema/aop
    http://www.springframework.org/schema/aop/spring-aop.xsd
    http://www.springframework.org/schema/tx
    http://www.springframework.org/schema/tx/spring-tx.xsd">

这个配置以后到底怎么弄?

还有这是关于什么的spring配置?

写回答

1回答

好帮手慕阿莹

2020-05-17

同学你好

1

这个是配置文件的约束头文件,同学可以从老师的项目中进行粘贴

或者也可以去官网中找对应的头文件

http://img.mukewang.com/climg/5ec0e79009e7b5e512100286.jpg

选择对应的版本:

http://img.mukewang.com/climg/5ec0e7cc097af97b13090732.jpg


找到http://img.mukewang.com/climg/5ec0e8890993de6613990487.jpg

往下拉,找到这样的示例,copy里边的头文件就好了。http://img.mukewang.com/climg/5ec0e8660953546613910464.jpg

但这样比较麻烦,建议同学直接保存老师项目提供的做一下备份就好

一般比较常用的也就这些

http://img.mukewang.com/climg/5ec0e8e209f8d76808170401.jpg

例如你写了:spring-beans  等实际上是用来约束以及提示对应标签的:

http://img.mukewang.com/climg/5ec0e92a091d906b09920352.jpg

同理:spring-context.xsd 等是用来约束以及提示

<context></context> 等

这些头约束文件同学可以都写上,也可以用哪些就写上哪些。

如果我的回答解决了你的疑惑,请采纳!祝学习愉快!


0

0 学习 · 8263 问题

查看课程