Hi all,
I have problem by binding the enum in <form:select>.
My enum looks as follow:
My Form-class looks as follow:Code:enum FizzyDrink{ pepsi("Pepsi"), coke("Coca Cola"), schweppes("Schweppes"); private String name; FizzyDrink(String name){ this.name = name; } public String getName(){ return name; }
And the code in the .jsp looks as follow:Code:class MyForm{ ... public List<String> getDrinkList(){ List<String> drinkList = new ArrayList<String>(); for(FizzyDrink f : FizzyDrink.values()){ drinkList.add(f.getName()); } return drinkList; } ... }
But I got exceptions that the 'name' cannot be mapped.Code:... <form:select path="drink" items="${applicationForm.drinkList}" itemValue="name" /> ...
I don't use MVC but Spring Web Flow. Someone has idea?


Reply With Quote