How I can bind a collection to a form for inputdata (not for show)
Asked
Active
Viewed 2,662 times
2 Answers
2
e.g. for a Set<Jokers>
protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws Exception {
binder.registerCustomEditor(
Set.class,
"[nameOfTheClassMemberItShouldGoto]",
new CustomCollectionEditor(Set.class) {
protected Object convertElement(Object element) {
return (element == null ? null : getQueryService().getJoker(element.toString()));
}
}
);
}
or similar to this

jitter
- 53,475
- 11
- 111
- 124
0
I did the same question and got a nice solution, take a look here How to bind a list of object to SpringMvc Controller?