Spring mvc 传送数组

Spring mvc 传递数组主要是加了个@RequestParam(value titles[])?Controller@RequestMapping(value/

Spring mvc 传递数组

主要是加了个@RequestParam(value = "titles[]")

?

Controller

@RequestMapping(value="/exportExcel", method = RequestMethod.POST)@ResponseBodypublic String exportExcel(@RequestParam(value = "titles[]") String[] titles){System.out.println(titles);return null;}

?

jsp页面

var param = {titles:['col1','col2','col3']};$.ajax({url:url, type:"post", data:param, async:false, dataType:"json", cache:false, error:function (data) {rtnObj = data.responseText;}, beforeSend:function (XMLHttpRequest) {//ajaxStart();}, complete:function (XMLHttpRequest, textStatus) {//ajaxComplete();}, success:function (data) {rtnObj = data;}});

?

1 楼 29120406 2013-08-07   为何这么叼