簡體   English   中英

找不到元素“ context:property-placeholder”的聲明

[英]Cannot found declaration for element “context:property-placeholder”

我是春季初學者。 我瀏覽了這個,只得到了這個筆記

我的兩個xml文件:

one.xml

<?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
    <entry key="url">stackoverflow.com/</entry>
</properties>

second.xml

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

<context:property-placeholder location="classpath:config.xml" />

<security:authentication-manager>
  <security:ldap-server url="${url}" 
    manager-dn="XXX" manager-password="XXX" />
</beans>

我得到的異常是:

找不到元素“ context:property-placeholder”的聲明

對於上下文模式名稱空間,您未指定模式位置。 這樣更改您的bean聲明。

<beans xmlns="http://www.springframework.org/schema/beans"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
   xmlns:security="http://www.springframework.org/schema/security"
   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/security
    http://www.springframework.org/schema/security/spring-security-3.0.xsd
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context-3.0.xsd">

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM