谁能告诉我 Spring 5 版本的 XSD 是否可用?
有没有类似的东西spring-beans-5.1.xsd
, spring-context-5.1.xsd
, spring-mvc-5.1.xsd
or spring-beans-5.0.xsd
, spring-context-5.0.xsd
, spring-mvc-5.0.xsd
春季有售吗?
如果有,请提供这些 XSD 的链接。
另外,谁能告诉我兼容版本是什么spring-security
for Spring 5.x
?
Spring 5 没有可用的 XSD。
Note: 与其提供显式版本的 XML 模式,不如选择可以支持任何版本的 spring 的通用 XML 模式。
XSD版本支持列表:
对于 spring-mvc :
-
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
-
http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
-
http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
-
http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
-
http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd
-
http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd
-
http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd
-
http://www.springframework.org/schema/mvc/spring-mvc.xsd http://www.springframework.org/schema/mvc/spring-mvc.xsd (通用的)
对于弹簧上下文:
-
http://www.springframework.org/schema/mvc/spring-context-2.5.xsd http://www.springframework.org/schema/mvc/spring-context-2.5.xsd
-
http://www.springframework.org/schema/mvc/spring-context-3.0.xsd http://www.springframework.org/schema/mvc/spring-context-3.0.xsd
-
http://www.springframework.org/schema/mvc/spring-context-3.1.xsd http://www.springframework.org/schema/mvc/spring-context-3.1.xsd
-
http://www.springframework.org/schema/mvc/spring-context-3.2.xsd http://www.springframework.org/schema/mvc/spring-context-3.2.xsd
-
http://www.springframework.org/schema/mvc/spring-context-4.0.xsd http://www.springframework.org/schema/mvc/spring-context-4.0.xsd
-
http://www.springframework.org/schema/mvc/spring-context-4.1.xsd http://www.springframework.org/schema/mvc/spring-context-4.1.xsd
-
http://www.springframework.org/schema/mvc/spring-context-4.2.xsd http://www.springframework.org/schema/mvc/spring-context-4.2.xsd
-
http://www.springframework.org/schema/mvc/spring-context-4.3.xsd http://www.springframework.org/schema/mvc/spring-context-4.3.xsd
-
http://www.springframework.org/schema/mvc/spring-context.xsd http://www.springframework.org/schema/mvc/spring-context.xsd (通用的)
对于春豆:
-
http://www.springframework.org/schema/mvc/spring-beans-2.5.xsd http://www.springframework.org/schema/mvc/spring-beans-2.5.xsd
-
http://www.springframework.org/schema/mvc/spring-beans-3.0.xsd http://www.springframework.org/schema/mvc/spring-beans-3.0.xsd
-
http://www.springframework.org/schema/mvc/spring-beans-3.1.xsd http://www.springframework.org/schema/mvc/spring-beans-3.1.xsd
-
http://www.springframework.org/schema/mvc/spring-beans-3.2.xsd http://www.springframework.org/schema/mvc/spring-beans-3.2.xsd
-
http://www.springframework.org/schema/mvc/spring-beans-4.0.xsd http://www.springframework.org/schema/mvc/spring-beans-4.0.xsd
-
http://www.springframework.org/schema/mvc/spring-beans-4.1.xsd http://www.springframework.org/schema/mvc/spring-beans-4.1.xsd
-
http://www.springframework.org/schema/mvc/spring-beans-4.2.xsd http://www.springframework.org/schema/mvc/spring-beans-4.2.xsd
-
http://www.springframework.org/schema/mvc/spring-beans-4.3.xsd http://www.springframework.org/schema/mvc/spring-beans-4.3.xsd
-
http://www.springframework.org/schema/mvc/spring-beans.xsd http://www.springframework.org/schema/mvc/spring-beans.xsd (通用的)
因此,我建议您使用通用 XSD,因为这可以减少为您正在使用的 Spring 版本选择哪个 XSD 版本的混乱。
只是一个例子:
<?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"
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/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<!-- Bean declaration and other configurations -->
</beans>
假设您使用的是 spring-core5.0.4.RELEASE
,那么 spring-security 的兼容版本是5.0.2.RELEASE
.
如果是maven项目,则在 pom.xml 中添加这些依赖项:
<dependencies>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>5.0.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>5.0.4.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>5.0.4.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>5.0.4.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>5.0.4.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.0.4.RELEASE</version>
</dependency>
</dependencies>
如何检查 spring-core、spring-beans、spring-context 等支持哪个版本的 spring security?
-
Open https://mvnrepository.com https://mvnrepository.com
-
在搜索框中输入 spring security
-
按回车键。
-
单击 Spring Security 核心。
- 单击您要使用的版本。假设我已经打开 5.0.2.RELEASE,然后查看编译依赖项。它将显示它支持的库列表。
- 请参阅 spring-beans、spring-context 等的版本。
Or
如果是普通项目,则从以下地址下载jarhttps://mvnrepository.com https://mvnrepository.com并添加项目中所需的适当的 spring jar。
Or
您可以从这里下载 Spring 版本 jar zip(全部合一):https://repo.spring.io/release/org/springframework/spring/ https://repo.spring.io/release/org/springframework/spring/
提取它并将所有 jar 添加到项目的类路径中。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)