I have 2 controllers in my app as follows
@Controller("/test1")
public class Test1Controller {
@RequestMapping("/new")
public String newtest1() {
//....
}
}
@Controller("/test2")
public class Test2Controller {
@RequestMapping("/new")
public String newtest2() {
//....
}
}
Now, if I make a request to /test2/new the request is going to the other controller /test1/new. Is there anything wrong here?
Resolving off the controller name is just a fallback, it won’t mix-and-match between that and actual request mappings. Just put a real request mapping on the controller.