Why doesn't SpringBootApplication register my controller as a handler?
<p>This is first time i am working with spring and I am kind a stuck. Here is what i have so far</p>

<p><strong>My Application that runs on embedded tomcat</strong></p>

<pre><code>package com.company.project.application;
@SpringBootApplication
public class SampleApplication {
    private static Log logger = LogFactory.getLog(SampleApplication.class);

    @Bean
    protected ServletContextListener listener(){
        return new ServletContextListener() {
            public void contextInitialized(ServletContextEvent servletContextEvent) {
                logger.info("ServletContext initialized ...");
            }

            public void contextDestroyed(ServletContextEvent servletContextEvent) {
                logger.info("ServletContext destroyed ... ");
            }
        };
    }

    public static void main (String[] args){
        SpringApplication.run(SampleApplication.class, args);
    }
}
</code></pre>

<p><strong>Controller</strong></p>

<pre><code>package com.company.project.controller;
@Controller
public class PaymentController {
    @RequestMapping("/")
    @ResponseBody
    public String helloWorld(){
        return "hello";
    }
}
</code></pre>

<p>I am running this application using the <code>SampleApplicaiton.main</code>. I can see the logs etc in console. When i try to access <code>http://localhost:8080/</code> it gives me <code>404</code>. When i try <code>http://localhost:8080/sampleapplication</code> or <code>http://localhost:8080/SampleApplication/</code> i get the same message. </p>

<p>What i am missing here ?</p>

<p><strong>SpringBoot Logs</strong></p>

<pre><code>  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.3.3.RELEASE)

2016-04-21 14:00:54.794  INFO 65461 --- [           main] c.w.p.application.SampleApplication   : Starting SampleApplication on WGs-MacBook-Pro.local with PID 65461 (/Users/username/repos/Sample/target/classes started by username in /Users/username/repos/sample)
2016-04-21 14:00:54.799  INFO 65461 --- [           main] c.w.p.application.SampleApplication   : No active profile set, falling back to default profiles: default
2016-04-21 14:00:54.892  INFO 65461 --- [           main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@1f021e6c: startup date [Thu Apr 21 14:00:54 EDT 2016]; root of context hierarchy
2016-04-21 14:00:55.794  INFO 65461 --- [           main] o.s.b.f.s.DefaultListableBeanFactory     : Overriding bean definition for bean 'beanNameViewResolver' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration; factoryMethodName=beanNameViewResolver; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter; factoryMethodName=beanNameViewResolver; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter.class]]
2016-04-21 14:00:56.411  INFO 65461 --- [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8080 (http)
2016-04-21 14:00:56.431  INFO 65461 --- [           main] o.apache.catalina.core.StandardService   : Starting service Tomcat
2016-04-21 14:00:56.433  INFO 65461 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet Engine: Apache Tomcat/8.0.32
2016-04-21 14:00:56.569  INFO 65461 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2016-04-21 14:00:56.569  INFO 65461 --- [ost-startStop-1] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 1697 ms
2016-04-21 14:00:56.838  INFO 65461 --- [ost-startStop-1] o.s.b.c.e.ServletRegistrationBean        : Mapping servlet: 'dispatcherServlet' to [/]
2016-04-21 14:00:56.846  INFO 65461 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean  : Mapping filter: 'characterEncodingFilter' to: [/*]
2016-04-21 14:00:56.847  INFO 65461 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean  : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2016-04-21 14:00:56.847  INFO 65461 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean  : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2016-04-21 14:00:56.847  INFO 65461 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean  : Mapping filter: 'requestContextFilter' to: [/*]
2016-04-21 14:00:56.879  INFO 65461 --- [ost-startStop-1] c.w.p.application.SampleApplication   : ServletContext initialized ...
2016-04-21 14:00:57.297  INFO 65461 --- [           main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@1f021e6c: startup date [Thu Apr 21 14:00:54 EDT 2016]; root of context hierarchy
2016-04-21 14:00:57.391  INFO 65461 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity&lt;java.util.Map&lt;java.lang.String, java.lang.Object&gt;&gt; org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2016-04-21 14:00:57.392  INFO 65461 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2016-04-21 14:00:57.418  INFO 65461 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2016-04-21 14:00:57.419  INFO 65461 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2016-04-21 14:00:57.467  INFO 65461 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2016-04-21 14:00:57.584  INFO 65461 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
2016-04-21 14:00:57.680  INFO 65461 --- [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http)
2016-04-21 14:00:57.686  INFO 65461 --- [           main] c.w.p.application.SampleApplication   : Started SampleApplication in 3.998 seconds (JVM running for 4.629)
2016-04-21 14:04:49.523  INFO 65461 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring FrameworkServlet 'dispatcherServlet'
2016-04-21 14:04:49.524  INFO 65461 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : FrameworkServlet 'dispatcherServlet': initialization started
2016-04-21 14:04:49.542  INFO 65461 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : FrameworkServlet 'dispatcherServlet': initialization completed in 18 ms
</code></pre>