I have array populated with elements and I want to display elements of that array in drop down list.
Here is relevant piece of code.
Party[] Parties = party.getAllParties;
In my jsp page, i have
<td nowrap>
<select label="Party List" array="Parties" name="Party List">
<option value=<%= (Parties) %>></option>
</select>
</td>
Now when i go and check view source of jsp page, i have
<td nowrap>
<select label="Party List" array="Parties" name="Party List">
<option value=[Lcom.areil.pdo.party.Party;@1404de3></option>
</select>
</td>
I know, way option value is set is not correct and am not sure what is right way of doing it.
Yes, it is because you are trying to display array directly.
The statement you have is equal to
System.out.println(Parties);You need to loop through the array and display each element by index like
parties[i].Example: