Контроллер :
package blog.controller;
import blog.dao.CategoryDao;
import blog.domain.Category;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Controller
@RequestMapping("/rest")
public class ServiceController {
@Autowired
private CategoryDao categoryDao;
@RequestMapping(value = "/categories")
@ResponseBody
public Category categories() {
Category category = categoryDao.getAllCategories().get(0);
return category ;
}
}
Ответ сервера :
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.8
В чем здесь проблема ?