【发布时间】:2012-06-07 11:21:58
【问题描述】:
我正在尝试将 String[] 从客户端发布到 Spring 3。在控制器端,我已经定义了这样的方法。
@RequestMapping(value = "somemethod", method = RequestMethod.POST)
public ModelAndView exportSomething(@RequestParam("sentences") String[] sentences) {
//.. logic
}
我发送的数据是这样的
sentences: ["a","b,c","d"]
问题是在服务器端,句子数组的大小是 4。它将 b 和 c 拆分为两个不同的单词。
这是 Spring 的问题还是我需要改变传递数据的方式?
【问题讨论】:
标签: java javascript spring spring-3