我想检索 map 中的所有表单参数
类似:
@RequestMapping(value = "/login", method = RequestMethod.POST)
public String login(Map<String, Object> formParams) {
//implementation
}
PS:我正在使用Spring MVC(版本4.1.1.RELEASE)
最佳答案
对参数应用 @RequestParam 注释。在这里查看更多:http://docs.spring.io/spring/docs/current/spring-framework-reference/html/mvc.html#mvc-ann-requestparam
“当在 Map 或 MultiValueMap 参数上使用 @RequestParam 注释时,映射将填充所有请求参数。”
关于java - [Spring MVC]- 如何检索 map 中的所有表单参数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28341950/