1. 程式人生 > >The prefix "p" for attribute "p:message" associated with an element type "bean"

The prefix "p" for attribute "p:message" associated with an element type "bean"

cat Coding beans oci 報錯 ram ttr sta ati

報錯的主要原因是因為,引用了spEL表達式,但是卻沒有引用相應的包

在bean.xml 中添加 xmlns:p="http://www.springframework.org/schema/p"

<?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:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">

<bean id="helloWorld" class="com.zjf.test.HelloWorld"
p:message="saynow" ></bean>

</beans>

The prefix "p" for attribute "p:message" associated with an element type "bean"