I need to populate a drop down with all the values within a list of strings.
Controller Class
@RequestMapping(value = \"/generateIds\", method = Requ
I have implemented a similar where i need to populate the dropdown from the database. For that I retrieved the data from the controller as below
@GetMapping("/addexpense")
public String addExpense(Expense expense,Model model){
model.addAttribute("categories",categoryRepo.findAll());
return "addExpense";
}
Then in the thymeleaf I have used the below code.