The prefix "p" for attribute "p:dataPattern" associated with an element type "bean" is not bound.

原因:

意思是: 前缀“p”属性“p:dataPattern。dataPattern”与某个元素类型相关“bean”却不被捆绑
 
这是因为在使用XML Schema作为配置文件的语义约束时,没有添加下面这条语句

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

 

解决办法:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:p="http://www.springframework.org/schema/p"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
        http://www.springframework.org/schema/mvc
        http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context-4.2.xsd">

 

posted @ 2017-08-30 17:21  lyhappyday  阅读(1432)  评论(0编辑  收藏  举报