我有一个工作的JpaRepository作为一个接口和一个工作的Restcontroller。@Repository和@RestController一起
目前他们是两种类型,我喜欢将他们加入到一个!
这是我有:
@Repository
@RestController("problem")
public interface ProblemsController extends JpaRepository<Problem, Integer> {
@RequestMapping(value = "all", method = RequestMethod.GET)
List<Problem> findAll();
}
但是,当我打电话http://localhost:8080/application/problem/all我得到一个404
怎么办?
你尝试用@RequestMapping(值=“/所有”,方法= RequestMethod.GET) – cralfaro
此外,我认为是一个错字,但你写applicatioin不应用 – cralfaro
@Peter Rader看看我的解决方案 –