Answer the question
In order to leave comments, you need to log in
What is the reason why Spring mvc controller can not be created if it contains java8 default methods?
there is a controller:
@RestController
@RequestMapping("/docs")
public class SomeController implements Controllable{
@RequestMapping("/info")
public ResponseEntity<String> info(){return new ResponseEntity<>("test");}
}
и
public interface Controllable{
@RequestMapping("/control", method=POST)
default ResponseEntity<String> control(){ return new ResponseEntity<>("control"); }
}
Answer the question
In order to leave comments, you need to log in
In general, when the application starts, messages about request mapping appear, like:
s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/docs/info],methods=[GET]}" onto ...
s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/docs/control],methods=[POST]}" onto ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question