springmvc 接受ajax请求 发生406错误

qq_24597963 qq_24597963 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
GET http://localhost:8080/GMM/seckill/1002/exposer.htm 406 (Not Acceptable)

  @RequestMapping(value = "/{seckillId}/exposer",
method = RequestMethod.GET,
produces = {"application/json;charset=UTF-8"})
@ResponseBody
public String exposer( @PathVariable("seckillId")Long seckillId)
{

ObjectMapper aaa=new ObjectMapper();
String aa=null;
SeckillResult<Exposer> result;
try{
Exposer exposer=seckillService.exportSeckillUrl(seckillId);
result=new SeckillResult<Exposer>(true,exposer);
aa = aaa.writeValueAsString(result);

}catch (Exception e)
{
e.printStackTrace();
result=new SeckillResult<Exposer>(false,e.getMessage());
try {
aa = aaa.writeValueAsString(result);
} catch (JsonProcessingException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}

return aa;
}



不知道错哪了 不是404 但是debug下进不了这个方法
...全文

相关推荐

评论 5
收藏 已收藏
分享
返回顶部
qq_24597963
Java EE 67,535 成员 225,843 内容