Friday, 21 February 2014

Basing a Component on another Component




Set the value of the $basedOn property to the Nucleus path of the component that will supply property values to the current component.

Consider the below example:

Consider we have two component file say compA.properties and compB.properties lets say compB want to use the configuration of compA(all the values and variables sharing) we give as $basedOn=/path/CompA

compA.properties
$class=com.classfile
name=kavi

compB.properties
$basedOn=path/compA

test.jsp

<importbean bean="./compB"/>
<dsp:valueof bean="compB.name"/>

output:
kavi

No comments:

Post a Comment