I get a result set from a query which has id and description, now I have to show the it in select tag some thing like this
You will need to do something like this.
<html:options name="myCollection" property="myValue"
The same goes for the "myCollection" bean, this is a bit more complex. Took me a while to get my head around...
"myCollection" should be either be an Object extending java.util.Collection or an array of Objects. It can't be a simple type (eg. int).
"myCollection" should be made up of other beans, with a getMyValue() and getMyLabelProperty() method.eg.
public class OptionItem
public String getMyValue()
public void setMyValue(String myValue)
this.myValue = myValue;
public String getMyLabel()
public void setMyLabel(String myLabel)
this.myLabel = myLabel;
I normally create a Vector and then populate it with these sort of beans.
I hope this is helpful to you.cheers,