spring p标签是spring内置的,只要在xml头部申明下就可以调用,用法相当于<property>
比如
<?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-2.5.xsd">
<bean id="loginAction" class="com.ambow.exam.action.LoginAction" p:nam="sasa"></bean>
</beans>
这里是给LoginAction里给nam注入值sasa
这里相当于
<?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-2.5.xsd">
<bean id="loginAction" class="com.ambow.exam.action.LoginAction">
<property name="nam">
<value>sasa</value>
</property>
</bean>
</beans>
http://www.cnblogs.com/iloveu/archive/2009/01/21/1379615.html