If the Student_01
component is referenced by an EL variable, you can use EL to display its property values, as in the following example. When the page is served, dsp:valueof
tags are replaced by the values of the specified component properties. If a value is null
, the default value No Name displays instead.
<dsp:getvalueof value="/samples/Student_01" var="student"> </dsp:getvalueof> ... Name: <dsp:valueof value="${student.name}">No Name</dsp:valueof> Name: <dsp:valueof value="${student.age}">No Name</dsp:valueof>
If no default value is required, you can use EL directly to specify display of the component property, as follows:
<dsp:getvalueof value="/samples/Student_01" var="student"> </dsp:getvalueof> ... Name: <c:out value="${student.name}"/> Name: <c:out value="${student.age}"/>