0

I am attaching the project structure.When I run as Spring boot application it shows white label errror. Since controller is in base package there is no need of component scan too.Can some one say whats the mistake. Project Structure

Controller:

@Controller 
public class HelloWorldController 
{ 
    @RequestMapping("/greeting") 
    public String greeting() 
    { 
       return "Hello World"; 
    } 
}
Romil Patel
  • 12,879
  • 7
  • 47
  • 76
Meenakshi
  • 468
  • 3
  • 12
  • 31
  • try this: https://docs.spring.io/spring-boot/docs/current/reference/html/getting-started-first-application.html – bananas Jul 01 '19 at 09:48
  • Possible duplicate of [Spring Boot Remove Whitelabel Error Page](https://stackoverflow.com/questions/25356781/spring-boot-remove-whitelabel-error-page) – Alexpandiyan Chokkan Jul 01 '19 at 11:47

1 Answers1

0

Use @RestController instead of @Controller if want to test you response output. Spring will treat this as rest controller. else, add @ResponseBody to your controller

fearaus
  • 21
  • 5