Hi sami25,
The arraylist is a list of STRING OBJECTS. I did the changes suggested by you..have replaced everything by names to avoid any confusion...however I still get the same error.
Following is the changed code
***************servlet-mapping file**************************
Code:
<bean name="/menu.htm" class="com.controllers.MenuController">
<property name="commandName" value="menu" />
<property name="formView" value="menu"/>
<property name="commandClass" value="com.util.Test"/>
<property name="successView" value="menu.htm"/>
</bean>
I have hard-coded the arraylist for now..so you get a clear picture
************MenuController.java******************
Code:
public MenuController() {
//setCommandName("menu");
//setCommandClass(MenuController.class);
}
public Map referenceData(HttpServletRequest req, Object obj, Errors errors) throws Exception {
Map names= new HashMap();
List nm= new ArrayList();
nm.add("103");
nm.add("104");
nm.add("105");
names.put("names",nm);
return names;
}
******************Menu.jsp*********************
Code:
<form:form method="post" commandName="menu">
<form:select path="names">
<form:option value="-" label="--Please Select"/>
<form:options items="${names}" />
</form:select>
The exception thrown by the application is..
Code:
SEVERE: Servlet.service() for servlet springapp threw exception
org.springframework.beans.NotReadablePropertyException: Invalid property 'names' of bean class [com.util.Test]: Bean property 'names' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter? at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:540)
at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:532)
.......
..........
..............
............
............
Please note, the application works fine and the drop-down is populated if I
replace the code in red by the following code
Code:
<form:form method="post" commandName="menu">
<select>
<option value="">--</option>
<c:forEach var="devname" items="${names}">
<option value='<c:out value="${devname}"/>'>
<c:out value="${devname}"/></option>
</c:forEach>
</select>
I think it searches for the property "names" in the commandclass defined com.util.Test and throws an exception because it doesnt find it there. 
Still not sure how to fix this...