title: Why I can replace @RestContoller with @Component and it still works?
body: <p>Can someone explain why replacement of <strong>RestController</strong> annotation with <strong>Component</strong> has no any visible effect in my case?
  My controller:</p>
  <pre><code>@RestController
  @RequestMapping(&quot;/api/employees&quot;)
  public class EmployeeController {
  
      @Autowired
      EmployeeService employeeService;
  
      @PostMapping(&quot;&quot;)
      public Employee saveEmployee(@Valid @RequestBody Employee employee) {
          return employeeService.save(employee);
      }
  
  
      ...
  
  </code></pre>
  <p>This works in the same way:</p>
  <pre><code>@Component
  @ResponseBody
  @RequestMapping(&quot;/api/employees&quot;)
  public class EmployeeController {
  
  ...
  </code></pre>