问答详情
源自:5-2 配置去掉Hibernate的配置文件-Spring整合Hibernate

为什么报错

为什么我的<context:property-placeholder location="classpath:jdbc.properties" ignore-unresolvable="true"/>报错,说是无法找到context:property-placeholder的声明;

表头我加了

 xmlns:context="http://www.springframework.org/schema/context"

xsi:schemaLocation="http://www.springframework.org/schema/beans

http://www.springframework.org/schema/context/spring-context.xsd

配置,在网上找说是没加刚才的配置

提问者:qq_关中二流子_04291279 2017-08-22 22:34

个回答

  • 水木星火
    2017-08-24 22:47:29

    下面也要加

    <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" >