Is there any way to select current value in dropdown list by Spring MVC by
?
No need to use if else
Example:
Student student = new Student();
student.gender = "F";
model.addObject("student", student);
Map genders = new LinkedHashMap();
genders.put("M", "Male");
genders.put("F", "Female");
model.addObject("genders", genders);
JSP Code
modelAttribute
& commandName
are interchangeable