谁能告诉我 Spring 5 版本的 XSD 是否可用?
有什么样spring-beans-5.1.xsd,spring-context-5.1.xsd,spring-mvc-5.1.xsd或spring-beans-5.0.xsd,spring-context-5.0.xsd,spring-mvc-5.0.xsd可在春季?
如果可用,请提供这些 XSD 的链接。
另外,谁能告诉我spring-securityfor的兼容版本是Spring 5.x什么?
Spring 5 没有可用的 XSD。
注意: 最好不要提供显式版本的 XML 模式,而是使用可以支持任何版本的 spring 的通用 XML 模式。
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.2.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.2.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-context-2.5.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.2.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.2.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-beans-2.5.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.2.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.2.xsd
http://www.springframework.org/schema/mvc/spring-beans-4.3.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>
Run Code Online (Sandbox Code Playgroud)
假设您使用的是 spring-core 5.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>
Run Code Online (Sandbox Code Playgroud)
在搜索框中输入 spring security
按回车键。
单击 Spring Security 核心。
如果是普通项目,则从https://mvnrepository.com下载 jar并添加项目中所需的相应 spring jar。
您可以从这里下载 Spring 版本 jar zip(全部在一个):https ://repo.spring.io/release/org/springframework/spring/
提取它并将所有 jar 添加到项目的类路径中。
| 归档时间: |
|
| 查看次数: |
10996 次 |
| 最近记录: |