【发布时间】:2013-08-06 21:46:08
【问题描述】:
我正在尝试在 Web 应用程序(REST、Spring、JPA Hibernate)中将布尔值作为 HTTP 响应返回。代码如下:
@ResponseBody
@RequestMapping(value="/movieTheater", method=RequestMethod.GET)
public boolean getCustomerInput(Map<String, Double> input) {
return transactionService.addTransaction(input);
}
现在,我想这不允许我返回一个布尔值,而是期待别的东西。当我尝试在浏览器中访问以下内容时:
http://localhost:8081/SpringMVCMerchant/movieTheater.htm
我收到以下错误:
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.
您能告诉我一种发送布尔值作为响应的方法吗?如果没有,我还能做什么? 提前致谢!
【问题讨论】:
标签: hibernate http rest spring-mvc tomcat7