java - <beans :beans> and <beans> 是什么意思

标签 java xml spring-mvc

有什么区别

<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-3.0.xsd  
    http://www.springframework.org/schema/context  
    http://www.springframework.org/schema/context/spring-context-3.0.xsd">  

<beans: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-3.0.xsd  
    http://www.springframework.org/schema/context  
    http://www.springframework.org/schema/context/spring-context-3.0.xsd">

您能解释一下这两者之间有什么区别吗?

最佳答案

它是一个 XML 命名空间,用于分隔可能存在冲突的元素名称,因此没有真正的区别。

XML Namespaces

关于java - <beans :beans> and <beans> 是什么意思,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29942374/

相关文章:

java - 找到搜索结果时抛出异常

Android 设置可见性不起作用

java - 为什么 @RequestParam 注解绑定(bind)请求体中的值?

java - 让我的第一个 Spring webapp 工作

java - 使用 spring boot/thymeleaf 重定向到 HTML 页面

java - 重构详细的 switch case 语句

java - 使用 ThreadPoolExecutor 使用 CompletableFuture 时在单个线程上设置超时

java - 左移丢失的信息是否存储在Java中的某个地方?

java - XStream - 解析嵌套元素(跳过父元素)

c# - XML 中缺少标记会阻止 XmlSerializer 创建属性