i know <bean:write> is used to get message from application properties file but where we use <bean:write>.what is the need?
Hi Amith,
Please note <bean:message> is used for wrtitng from the application properties file. But <bean:write> is used in conjunction with <logic
resent>, <logic:iterate> to write on a
JSP from a collection that is in ActionForm.
Example:<bean:message>
---------------
<bean:message key="label.search.name"/>:
<html:text property="fname"/>
this is same as:
Name:
<html:text property="fname"/>
Application Properties file
label.search.name=Name
--------------------------------
<bean:write>
<logic:iterate id="anyname" name="searchForm" property="results">
<tr>
<td><bean:write name="anyname" property="name"/></td>
<td><bean:write name="anyname" property="ssNum"/></td>
</tr>
</logic:iterate>
the ActionForm would have a collection as:
public void setResults(List results) {
this.results = results;
}
Thus it is used to write the dynamic values on the JSP..
Hope it helps..
[ November 06, 2006: Message edited by: RoshaniG Gopal ]