前台用ajax post过来的数据后台要怎样接收?

怎么老是报这种错误的?...展开


德玛西亚99
浏览 1305回答 1
1回答

阿波罗的战车

导入jQuery包jQuery(document).ready(function($){var url = "";var data = {"param":"我是参数","other":"me too"};$.post(url,data,function(result){//.............});});private String param;private String other;public void Test(){PrintWriter out = null;try{out = getResponse().getWriter();if(param.equals("我是参数")){out.print(other);}}catch(Exception e){//...}finally{out.flush();out.close();}}//getter and setter...jQuery(document).ready(function($){var url = "";var data = {"param":"我是参数","other":"me too"};$.post(url,data,function(result){alert(result);});});
打开App,查看更多内容
随时随地看视频慕课网APP