首页 > 解决方案 > 在 SpringBoot 中将列表绑定到模型属性

问题描述

我想将列表绑定到模型中的属性

控制器

@GetMapping("search")
public ResponseEntity<SearchResponseWrapper> fetchSearchResults(SearchCriteria searchCriteria) {
}

模型

public class SearchCriteria {
     public List<String> pageSources;

     ...//some other attribute
     ...//some other attribute
}

以及将多个值传递给 URL 中的单个参数的正确方法是什么。

标签: javarestspring-boot

解决方案


推荐阅读