|
get
|
Description |
This tag retrieves the specified property and writes
its value to the page output. |
Tag Body |
Empty |
Restrictions |
If the name attribute is not specified then uses a parent
bean tag to locate the bean on which to operate. The property
attribute should be used to specify what to retrieve; if not specified then the
bean object itself is retrieved as a string. The id attribute specifies
the name to save the retrieved property as; useful for non-string properties.
If the eval attribute is specified then the value of the attribute is
evaluated and written to the page output; this replaces the bean processing
described above. |
Attributes |
This tag has the following attributes:
Attribute |
Description |
Req'd? |
| name |
Name of the bean to use. |
No |
| property |
Name of the property to retrieve. If not specified then the bean itself is
retrieve as a string. |
Yes |
| id |
Name to save the retrieved value as. |
No |
| eval |
Attribute to evaluate and write to page output. |
No |
| edit |
Specifies the edit bean that will be applied
to the returned value. |
No |
|
Properties |
None.
|
Example(s) |
<%-- get the date time property from parent bean --%>
<util:bean type="java.util.Date">
time = <util:get property="time"/>
</util:bean>
<%-- get the date time property from named bean --%>
<util:bean id="date" type="java.util.Date"/>
...
time = <util:get name="date" property="time"/>
<%-- get the date bean itself as a string --%>
<util:bean type="java.util.Date">
date = <util:get/>
</util:bean>
<%-- get a non-string bean property --%>
<util:bean: type="Bean">
<util:get property="prop" id="handle"/>
</util:bean>
<%-- get an evaluated attribute --%>
<util:catalog id="catalog" resource="catalog"/>
<util:bean id="bean" type="java.util.Date"/>
Msg = <util:get eval="$[catalog:msg]"/>
Param = <util:get eval="$(requestparam)"/>
Bean = <util:get eval="{bean}"/>
|