【发布时间】:2017-07-31 19:55:07
【问题描述】:
我收到 400 错误 - 错误请求
类型状态报告
描述由于被认为是客户端错误(例如,格式错误的请求语法、无效的请求消息帧或欺骗性请求路由),服务器无法或不会处理请求。
问题来自:
<form:select path="children" multiple="multiple">
<form:options items="${animals}" itemValue="key" itemLabel="name"/>
</form:select>
这里是控制器:
@RequestMapping(value = "/saveAnimal", method = RequestMethod.POST)
public ModelAndView saveAnimal(@ModelAttribute Animal animal,HttpServletRequest request) {
if(animal.getKey() == null) {
animalService.addAnimal(animal);
}
else animalService.updateAnimal(animal);
return new ModelAndView("redirect:/animals");
}
我不确定如何从多选中检索值。没有这个字段一切正常。任何帮助将不胜感激。
【问题讨论】:
标签: java spring jsp spring-mvc jsp-tags