OK, the solution of above problem is very simple to achieve when the list contains String values.
Example:
Code:
public class BeanService{
private List<String> list = new ArrayList<String>();
//setters and getters
}
and the JSP:
Code:
<form:form commandName="beanService"
<c:if test="${fn:length(someList) > 0}">
<c:forEach items="${someList}" var="ff">
"${ff.label}": <form:input path="list"/>
</c:forEach>
<input type="submit" value="Add">
</c:if>
</form:form>
But now the problem is when the list in BeanService class holds custom type objects:
Code:
public class Bean{
private List<CustomType> list = new ArrayList<Custom>();
//setters and getters
}
and the CustomType looks like:
Code:
public class CustomType{
private String value;
private String type;
//setters and getters...
and values of 'value' and 'type' in CustomType comes from above JSP.
Any help?