使用jquery的.ajax给spring mvc的后台发送一个请求,在界面测试的时候,可以有返回,但是到代码里就是执行的jquery的error部分,不成功。java中的返回代码如下:ObjectMapper mapper = new ObjectMapper();
Map lzp = new HashMap();
lzp.put("data", str);
try {
content = mapper.writeValueAsString(lzp);
System.out.println("content:"+content);
} catch (Exception e) {
// TODO Auto-generated catch block
System.out.println(e);
}
return content;
添加回答
举报
0/150
提交
取消