你不想要 json 串形式的返回?
解决方案 »
- 求租一个Jsp页面中如何冻结首列的问题
- 博客空间提问没人去,转到这里.(fckeditor文章编辑器的小问题)
- java中web页面问题
- java mail用imap收取邮件怎么做,求解答!!!!
- 求救:java.lang.IllegalArgumentException: bad date header: 'n 2007 01:52:06 GMT'
- 从前没有搞过,虚心求教:JSP网页上显示实时视频的问题。
- tomcat安装不了 出现这样的提示信息
- 超级简单问题为什么会出错(关于long变量)
- 图片上传
- 怎么知道mysql使用什么中文编码方式(charsetEncoding)?或者说怎么设置中文编码方式?
- 新手求学,大神们指导下行不。
- java能用算法实现找到这条线最大的跌幅的区间吗?
是个字符串,关键是它在页面上看到的是方法参数的json,而不是方法返回值的JSOn
是的,我是想要方法返回值的JSON
/**
* 测试返回JSON数据
* @param session
* @return
*/
@RequestMapping(value="/test")
@ResponseBody
public Object test(HttpSession session){
System.out.println("test....................");
return session.getAttribute("permit");
}
http://localhost:8090/YueHuiBarWechat/api/index.json?signature=wexin×tamp=123&nonce=321&echostr=456加上@ResponseBody json正常,但是XML就报错了http://localhost:8090/YueHuiBarWechat/api/index.xml?signature=wexin×tamp=123&nonce=321&echostr=456This page contains the following errors:error on line 1 at column 1: Document is empty
Below is a rendering of the page up to the first error.
@ResponseBody
public String index(WechatCallbackAPI callbackApi) {
String validStr = callbackApi.valid();
return validStr;
// map.addAttribute("vv", validStr);
}
到底是想返回 json,还是 html 页面