Thanks
Alan.
I'll use the following code give by you.
I've 2 more things to incorporate with this.
1)There may be 50(or more) input fields. So I think it'll not be a good idea to use something like FormBeanName.name, FormBeanName.Address, FormBeanName.location in <c:if.... for 50 times. If I can use something generic for my form-bean attributes (name, address,location etc.) that will be great.
(like If I can iterate over the attributes of the form-bean).
2)I'm getting the label for the particular attribute from messageresources.properties file. In the current case where we're
testing for each attribute of the form-bean, i can get it using <bean:message key="search.name"/> and similarly for other attributes. But If we're using something dynamic like <c:if test="${requestScope.FormBeanName.
$attribute. In that scenario how will I use that generic attribute as a key in <bean:message/>.
Hope I made my problems clear. Thanks a lot for helping me out on this.