ITPub博客

首页 > IT职业 > IT图书 > java中在tomcat获取绝对路径的问题

java中在tomcat获取绝对路径的问题

IT图书 作者:seiya 时间:2021-09-09 08:57:58 0 删除 编辑

使用SpsringMVC,使用restEasy调试,controller请求设置如下:
Java代码 收藏代码
@RequestMapping(value="/list",method=RequestMethod.GET,produces=MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
public List list(){
List list = editImpl.selectAll();
return list;
}

请求,debug跟踪list是返回值没有问题,但是前台页面报如下错误:
Java代码 收藏代码
Response Status: 406 (Not Acceptable)

Response RAW返回值如下,(前半部分)
Xml代码 收藏代码
HTTP GET http://127.0.0.1:8080/onlineLibrary/rest/system/editTimeout/list
Host: 127.0.0.1:8080

406 Not Acceptable
Date: Sat, 17 Aug 2013 11:01:07 GMT
Server: Apache-Coyote/1.1
Content-Length: 1067
Content-Type: text/html;charset=utf-8

Apache Tomcat/7.0.34 - Error report

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/4586/viewspace-2798316/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-08-13

  • 博文量
    81
  • 访问量
    676