I have 2 objects: Car and person
A person has the following attributes: A int id, String name, List<Car> cars
car has the following variables:
int id, String make
I am trying to create an update view for a person.
I pass a person object and a model attribute list containing all the cars
person.cars = {"BMW","MERCEDES"}
allCars = {"BMW","TOYOTA","HONDA","MERCEDES","KIA","HYUNDAI"}
When I use <form:select/>with <form:options items=${allCars} .. />, I see all the cars ..
I was wondering if there is a spring way without writing many JSTL loops to pre-select the cars that a person has.
thank
source
share