I have written a simple code for springboot with rest controller. It runs fine but does not hit the endpoint.
My Application class:
@SpringBootApplication
public class SpringbootRestTemplateDemo {
public static void main(String[] args) {
SpringApplication.run(SpringbootRestTemplateDemo.class, args);
System.out.println("Springboot Rest template demo");
}
}
My controller class:
@RestController
public class ProductController {
@RequestMapping(value="/product/details", method=RequestMethod.GET)
public String getProduct() {
return "Product details";
}
}
I expect a simple message using get request but it is not hitting the endpoint. Input: http://localhost:8080/product/details
output:
Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback.
Thu Mar 28 19:34:44 IST 2019 There was an unexpected error (type=Not Found, status=404). No message available