前端代码:
var paramData ={} ;
paramData['account']= "123456" ;
urlIn='${base}/home/getCurrLoadingChartData.nut';
$.ajax({
type : "POST",
url : urlIn,
dataType : "json",
data:JSON.stringify(paramData),
async : false,
success : function(datas) {
}
});
后台代码:
@At("/getJKInfo")
@AdaptBy(type = JsonAdaptor.class)
@Ok("json")
@RequiresAuthentication
public Object getJKInfo(@Param("account") String account) {
return homeService.getJKInfo("160614133542");
}
DEBUG进去account为null
请求监控信息:
Request URL:http://localhost:8080/platform/wdg/home/getJKInfo.nut
Request Method:POST
Status Code:200 OK
Response Headers
view source
Cache-Control:no-cache
Content-Type:application/json; charset=UTF-8
Date:Tue, 25 Oct 2016 14:05:33 GMT
Server:Jetty(9.2.17.v20160517)
Transfer-Encoding:chunked
X-Powered-By:nutz/1.r.58 <nutzam.com>
Request Headers
view source
Accept:application/json, text/javascript, */*; q=0.01
Accept-Encoding:gzip, deflate
Accept-Language:zh-CN,zh;q=0.8
Cache-Control:max-age=0
Connection:keep-alive
Content-Length:19
Content-Type:application/x-www-form-urlencoded;charset=UTF-8
Cookie:sid=f940dfed-f744-4e41-84e0-ae173db1ca52
Host:localhost:8080
Origin:http://localhost:8080
Referer:http://localhost:8080/platform/home
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36
X-Requested-With:XMLHttpRequest
Form Data
view source
view URL encoded
{"account":"12345"}: