Cześć,

Mój controller wygląda tak:

    @RequestMapping(value = "/createanimal/bird", method = RequestMethod.GET)
    public ModelAndView createBird()
    {
        ArrayList<AnimalType> typeBirdList = new ArrayList<AnimalType>(
                Arrays.asList(BirdTypeEnum.values()));
        ArrayList<AnimalType> typeFishList = new ArrayList<AnimalType>(
                Arrays.asList(FishTypeEnum.values()));
        ArrayList<AnimalType> typeMammalList = new ArrayList<AnimalType>(
                Arrays.asList(MammalTypeEnum.values()));

        Map<String, ArrayList<AnimalType>> animalsTypes = new HashMap<String, ArrayList<AnimalType>>();

        animalsTypes.put("Bird", typeBirdList);
        animalsTypes.put("Fish", typeFishList);
        animalsTypes.put("Mammal", typeMammalList);

        List<SexEnum> sexList = new ArrayList<SexEnum>(Arrays.asList(SexEnum
                .values()));
        List<SizeEnum> sizeList = new ArrayList<SizeEnum>(
                Arrays.asList(SizeEnum.values()));

        ModelAndView model = new ModelAndView();
        model.addObject("bird", new Bird());
        model.addObject("details", new AnimalDetails());
        model.addObject("sexList", sexList);
        model.addObject("sizeList", sizeList);
        model.addObject("typeBirdList", typeBirdList);
        model.addObject("animalsTypes", animalsTypes);
        model.setViewName("bird");
        return model;
    }

Teraz chciałbym w widoku mieć dwa selecty, gdzie w jednym wybieram klucz i na podstawie klucza w drugim selecie są wartości odpowiednie do klucza, da się tak zrobić?

Samo wybieranie klucza mam:

            <tr>
                <td>Type <select
                    name="animalsTypes">
                        <c:forEach items="${animalsTypes}" var="type">
                            <option value="${type.key}">
                                <c:out value="${type.key}"></c:out>
                            </option>
                        </c:forEach>
                </select></td>
            </tr>