Learning Spring Rest, были некоторые сомнения по поводу ниже:
@RestController
public class TestController {
@Autowired
private TestService testService;
@GetMapping("/test")
public int testTransaction(){
return 10;
}
}
Вышеупомянутый фрагмент работал очень хорошо, и дал ответ 10.
@RestController("/test")
public class TestController {
@Autowired
private TestService testService;
@GetMapping
public int testTransaction(){
return 10;
}
}
Для вышеупомянутого фрагмента, я получил ошибку как показано ниже:
threw exception No adapter for handler The DispatcherServlet configuration needs to include a HandlerAdapter that supports this handler with root cause
Есть идеи? Что может быть причиной..? Я думаю, что оба должны работать, но выше одного не работает ...