The project (SpringBoot 2+, thymeleaf) has a simple restore controller of the form:
@RestController public class Controller { @GetMapping ("/index") public String index() { return "Hellow"; } If you run in this form, then the request to localhost:8080/index processed normally, all that except this address does not pass (for example, localhost:8080/index/ - will give 404). But if you hang an annotation on the class:
@RestController ("/index") public class Controller { @GetMapping public String index() { return "Hellow"; } That requests are processed incorrectly - for all requests, localhost:8080/index/ , localhost:8080/ , even garbage addresses on which there is no mapping - localhost:8080/qqqqqq ) - return instead of 404 - "Hellow".
Why? Why in the second case all requests to the application go to this controller, although I set the mapping to a specific context ("/ index")?