<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-2.0.xsd">
p标签相当于spring中的property标签(在spring源码中,property标签和p标签都相当于set方法)
<!-- 商品图片上传 -->
<bean id="productExtraAction" class="com.abacus.web.action.pms.ProductExtraAction"
p:productService-ref="productService" //该service关联其他的bean,就需要加ref
p:allowType="gif,jpeg,pjpeg,png,x-png,bmp,txt,html"//该属性,在action中有个set方法。不予其他的bean关联
scope="prototype"/>
注意:无论p标签还是property标签,都是执行类中的set方法。因此,没有set方法就不能使用两个标签