I'm seeting up Rest end point & @Restcontroller doesnt accept/Map any incomming requests if placed in difefrent package,but works fine if placed in main class package
Spring boot being set-up in Eclipse IDE.
SpringApp.java (main method) in com.java package --------- Work's fine
@SpringBootApplication
@RestController
public class SpringApp
{
@RequestMapping("/welcome")
String welcome() {
return "Hello!! welcome";
}
public static void main(String[] args) {
SpringApplication.run(SpringApp.class, args);
}
}
TestController.java in com.controller package ---- Doesn't work
@RestController
public class TestController {
@RequestMapping("/welcome")
String welcome() {
return "Hello!! welcome";
}
I expected the request to get mapped irrespective of the package in which they are placed