title: How are injected these classes into my Spring controller class?
body: <p>I am pretty new in Spring and I have some doubts about how is injected some classes into a controller class.</p>
  
  <p>Into my project I have this <strong>HomeController</strong> class:</p>
  
  <pre><code>@Controller
  public class HomeController {
  
      private static final Logger logger = LoggerFactory.getLogger(HomeController.class);
      @Autowired
      private MessageSource  messageSource;
      @Autowired
      private Environment env;
  
      .....................................................
      .....................................................
      .....................................................
  }
  </code></pre>
  
  <p>My doubt is related to the 2 objects <strong>MessageSource  messageSource</strong> and <strong>Environment env</strong> classes.</p>
  
  <p>As you can see these classes are injected by the <strong>@Autowired</strong> annotation.</p>
  
  <p>The problem is that I have not bean definition into my XML configuration for these classes. So why are correctly injected? Where are the definition of these bean?</p>
  
  <p>Tnx</p>