title: Usage of @Componenscan in Springboot Spring MVC Application
body: <p>my problem is that i dont know how to specify the path for my Controller package to search for requestmapping annotations inside it in the @componenscan annotation, which is in the main class.</p>
  
  <p>Project structure:
  <a href="https://i.stack.imgur.com/4krFI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4krFI.png" alt="enter image description here"></a></p>
  
  <p>My DemoApplication class:</p>
  
  <pre><code>package com.personalitymeet;
  
  import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
  import org.springframework.context.annotation.ComponentScan;
  import org.springframework.context.annotation.Configuration;
  import org.springframework.stereotype.Controller;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.ResponseBody;
  
  @Configuration
  @EnableAutoConfiguration
  @ComponentScan()
  @Controller
  public class DemoApplication {
  
  @ResponseBody
  @RequestMapping("/")
  String entry(){
      return "bla";
  }
  public static void main(String[] args) {
      SpringApplication.run(DemoApplication.class, args);
  }
  }
  </code></pre>
  
  <p>Usercontroller.java:</p>
  
  <pre><code>package com.personalitymeet.web;
  
  import com.personalitymeet.domain.User;
  import org.springframework.stereotype.Controller;
  import org.springframework.ui.Model;
  import org.springframework.web.bind.annotation.RequestMapping;
  
  /**
   * Created by mv on 15.09.2016.
   */
  
  @Controller
  public class UserController {
  
      @RequestMapping("/user")
      public String user(Model model){
          User user = new User();
          user.setFirstname("Misi");
          user.setLastname("Varga");
          model.addAttribute("user",user);
          return "userview";
      }
  
  }
  </code></pre>
  
  <p>So, my question is, how can i tell springboots that it should search for @Requestmapping annotation in the Usercontroller class?</p>