ajax请求的数据tp5怎么返回json数据
2017-03-06 · 做真实的自己 用良心做教育
千锋教育
千锋教育专注HTML5大前端、JavaEE、Python、人工智能、UI&UE、云计算、全栈软件测试、大数据、物联网+嵌入式、Unity游戏开发、网络安全、互联网营销、Go语言等培训教育。
向TA提问
关注
展开全部
eq(i),map).length == 0) {
18 alert(" i <
15 po.html());
30 }
31 return new ModelAndView(new MappingJackson2JsonView(););
10 var o=ss:
1 /String;label'";msg".setCreateTime(new Date());
37 }.length >error"
40 }
41 }); 0) {
10 for(String s .find('.POST)
2 public @ResponseBody ModelAndView saveSynchronizedData(@RequestParam(":
1 @RequestMapping(value = ".ajax({
31 type; i ++) {
23 if(i == cacheSelectAry.setCustomerCode(s):\, method = RequestMethod, String> cacheSelectAry;
13 po;label'
16 vcHService;));checkbox'
19 return,
33 url;**
2 * 保存-同步(版本控制库)
3 */.MappingJackson2JsonView.printStackTrace(); checked属性会被
13 if(s : ary) {
11 VCHousePo po = new VCHousePo();"cityIds\.setExceptionState(0);value'"]",
38 error;
4 function saveSynchronizedVcHorse(obj) {
5 var ss = $("一: function () {/ map = new HashMap<.attr("",", "error"
24 } catch (JsonMappingException e) {
25 e;
29 map;": "/.put(");XMLHttpRequest;main/.json;".put("
21 } catch (JsonParseException e) {
22 e;
12 po.springframework.put(".setExceptionId(bean;checked'"、以ModelAndView的方式返回
先看下JavaScript代码;]}"saveSynchronizedData".servlet;);;
27 } catch (IOException e) {
28 e.web;;+ cacheSelectAry[i] + ".length -1) {
24 json = json +";
11
12 var s = $(o).class).length; i </:["/checked"saveSynchronizedData"
27 }
28 }
29 json = json + ").getExceptionId()).getCityIds();.eq(i);,
35 success;\\!= null) {
14 cacheSelectAry;
42 }
主要是看ajax请求部分;;json"!= null && ary.push($(o):MappingJackson2JsonView使用的package是
import org;
15 }
16 }
17 if(cacheSelectAry.attr('+exceptionId+").readValue(mSynchronizedJSON;请选择城市"".add(po), String>/: function(msg){
36 alert(msg;
20 }
21 var json = ", "。另外;();alert(ss;
25 } else {
26 json = json + ".eq(i);
6 var cacheSelectAry = new Array()
7 for(var i = 0;#SynchronizedSelection div"SynchronizedBean={\.printStackTrace();"\.put("
30 $;
32 }
这里是通过ModelAndView的方式进行返回JSON的;/./; ss;input[type=': ",
34 data;, SynchronizedBean;
14 po;msg");
9 /.length;);)!= null) {
8 String[] ary = bean; i ++) {
8 /.find("
4 Map<;alert(ss;);;
5 try {
6 SynchronizedBean bean = objectMapper, "", errorThrown
39 alert(".html());"
17 }
18 }
19 }
20 map;/;success"\ + cacheSelectAry[i] + ": ".find('.attr(';\",
32 dataType;由于$(obj).view, false): json.;请求失败");msg", "exceptionId\"POST",\
9 if(ary ;String;
22 for(var i = 0;".printStackTrace();;error".main), textStatus。
再看Spring 中控制器的代码;SynchronizedBean") String mSynchronizedJSON) {
3 ObjectMapper objectMapper = new ObjectMapper();
7 if(bean ;msg"
23 map;
26 map;)
18 alert(" i <
15 po.html());
30 }
31 return new ModelAndView(new MappingJackson2JsonView(););
10 var o=ss:
1 /String;label'";msg".setCreateTime(new Date());
37 }.length >error"
40 }
41 }); 0) {
10 for(String s .find('.POST)
2 public @ResponseBody ModelAndView saveSynchronizedData(@RequestParam(":
1 @RequestMapping(value = ".ajax({
31 type; i ++) {
23 if(i == cacheSelectAry.setCustomerCode(s):\, method = RequestMethod, String> cacheSelectAry;
13 po;label'
16 vcHService;));checkbox'
19 return,
33 url;**
2 * 保存-同步(版本控制库)
3 */.MappingJackson2JsonView.printStackTrace(); checked属性会被
13 if(s : ary) {
11 VCHousePo po = new VCHousePo();"cityIds\.setExceptionState(0);value'"]",
38 error;
4 function saveSynchronizedVcHorse(obj) {
5 var ss = $("一: function () {/ map = new HashMap<.attr("",", "error"
24 } catch (JsonMappingException e) {
25 e;
29 map;": "/.put(");XMLHttpRequest;main/.json;".put("
21 } catch (JsonParseException e) {
22 e;
12 po.springframework.put(".setExceptionId(bean;checked'"、以ModelAndView的方式返回
先看下JavaScript代码;]}"saveSynchronizedData".servlet;);;
27 } catch (IOException e) {
28 e.web;;+ cacheSelectAry[i] + ".length -1) {
24 json = json +";
11
12 var s = $(o).class).length; i </:["/checked"saveSynchronizedData"
27 }
28 }
29 json = json + ").getExceptionId()).getCityIds();.eq(i);,
35 success;\\!= null) {
14 cacheSelectAry;
42 }
主要是看ajax请求部分;;json"!= null && ary.push($(o):MappingJackson2JsonView使用的package是
import org;
15 }
16 }
17 if(cacheSelectAry.attr('+exceptionId+").readValue(mSynchronizedJSON;请选择城市"".add(po), String>/: function(msg){
36 alert(msg;
20 }
21 var json = ", "。另外;();alert(ss;
25 } else {
26 json = json + ".eq(i);
6 var cacheSelectAry = new Array()
7 for(var i = 0;#SynchronizedSelection div"SynchronizedBean={\.printStackTrace();"\.put("
30 $;
32 }
这里是通过ModelAndView的方式进行返回JSON的;/./; ss;input[type=': ",
34 data;, SynchronizedBean;
14 po;msg");
9 /.length;);)!= null) {
8 String[] ary = bean; i ++) {
8 /.find("
4 Map<;alert(ss;);;
5 try {
6 SynchronizedBean bean = objectMapper, "", errorThrown
39 alert(".html());"
17 }
18 }
19 }
20 map;/;success"\ + cacheSelectAry[i] + ": ".find('.attr(';\",
32 dataType;由于$(obj).view, false): json.;请求失败");msg", "exceptionId\"POST",\
9 if(ary ;String;
22 for(var i = 0;".printStackTrace();;error".main), textStatus。
再看Spring 中控制器的代码;SynchronizedBean") String mSynchronizedJSON) {
3 ObjectMapper objectMapper = new ObjectMapper();
7 if(bean ;msg"
23 map;
26 map;)
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询