问答详情
源自:3-2 使用SpringMVC实现Restful接口(下)

springmvc ajax json输不出来

HTTP Status 406 - type Status report message description The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request "accept" headers. Apache Tomcat/8.0.36 老师,这个怎么解?

提问者:neroyang 2016-08-20 17:36

个回答

  • 慕粉3481364
    2017-06-29 17:21:03

    遇到一样的问题,求帮忙解答

  • neroyang
    2016-08-20 19:41:20

    Operate 忘了getter/setter方法

  • neroyang
    2016-08-20 17:37:22

    这是controller代码

    @RequestMapping(value = "/{a}/pu",
            method = RequestMethod.GET,
            produces = {"application/json;charset=UTF-8"})
    @ResponseBody
    public Operate pu(@PathVariable("a") String a){
        Operate operate = new Operate(true,a,0001);
        return operate;
    }