I’m trying to do a CRUD for my bean in Spring MVC and i found it to be a bit overwhelming.
thing is, that one of bean element is ArrayList of another class
its looks like
class Bean{
...
String componentName;
ArrayList<InnerComponent> component;
...
}
With getters and setters ofc
and InnerComponent is pritty simple, its like
class InnerComponent{
String key;
String va;
}
now Question: How can i create form, that allows to input something in that array list?
<form:form commandName="Bean" id="Bean" action="#">
<form:input type="text" path="componentName" /><br />
....??
<form:button>Submit</form:button>
</form:form>
Can figure this out…
you need to use CustomPropertyEditors for such.
1) here is thread having same question.
2) here is stackoverflow link.
3) here is Spring 3 reference doc link of propertyEditors chapter.