I have seen two questions relating to my topic on stackoverflow, but those answers did not work for me, hence this question. I have the following object
public class CartProduct {
private ArrayList<String> accList = new ArrayList<String>();
public void setAccList(ArrayList<String> str)
{
this.accList = str;
}
public ArrayList<String> getAccList()
{
return accList;
}
I am using the following code to access this list and then its individual items using JSTL so that they can populate a list box in a JSP. But this code is not working and I dont seem to understand why?
<td><select name = "acc_no">
<Option value = "select">SELECT</Option>
<c:forEach items="${item.product.accList}" var="acno">
<option>${acno}</option>
</c:forEach>
</select>
The list box is empty except for the SELECT word.
The JSTL code looks fine. The JSP page is simply not accessing the instance you think it is accessing.