【发布时间】:2016-06-29 11:29:54
【问题描述】:
@RequestMapping(value = "/servers/{domain}", method = RequestMethod.GET)
public Server getMailServer(@PathVariable("domain") String domain)
Server server = null;
try {
server = getServerByDomain(domain);
}
catch(Exception e){
}
return server;
}
当我用 HttpClient Get 方法调用“http://localhost:8080/server/hotmail.com”时,变量域的值是“hotmail”,而不是“hotmail.com”。我得到了错误: HttpMediaTypeNotAcceptableException: 找不到可接受的表示。
但如果我打电话给“http://localhost:8080/server/hotmail”,效果很好。
我希望有人能看看是什么导致了这个问题。
【问题讨论】:
标签: spring-mvc