In Spring based applications, p-NameSpace (Parameter Namespace) provides a substitute for Property tag. With the help of "p-Namespce", it helps to inject the dependency Injection by allowing direct to use bean tag irrespective of property tag.
The benefits of using p-namespce are as follows :
Using "p" as tag is more compact than property tag
Simplifies the setter-based dependency injection code
Using p namespace reduces the amount of XML required in Spring configuration
In order to use p-namespace follow the following steps:
In the configuration xml file, add "p" namespace URI like `"xmlns:p="http://www.springframework.org/schema/p"
For each property tag add an attribute p:value and set the attribute value to it
If one of your property is expecting another bean , then you should suffix -ref to your property name
0 Comment(s)