How do I populate a drop down with a list using thymeleaf and spring

前端 未结 5 1923
天涯浪人
天涯浪人 2020-11-29 06:26

I need to populate a drop down with all the values within a list of strings.

Controller Class

@RequestMapping(value = \"/generateIds\", method = Requ         


        
5条回答
  •  不知归路
    2020-11-29 07:22

    For generating dropdown for the list of String returned in model you just need to use these lines. You don't need to create any model class with extra getter and setter methods. Your code is correct, you just missed the variable name for storing the value returned in countryName list in th:each.

    
    

提交回复
热议问题