Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

287
Views
Autowire sin anotación @Autowired

Estoy viendo un ejemplo antiguo que tengo en el espacio de trabajo. No puedo ver cómo se realiza el cableado automático ya que no hay @Autowired . Spring boot + configuraciones predeterminadas de facebook.

 @Controller @RequestMapping("/") public class HelloController { private Facebook facebook; private ConnectionRepository connectionRepository; public HelloController(Facebook facebook, ConnectionRepository connectionRepository) { this.facebook = facebook; this.connectionRepository = connectionRepository; } @GetMapping public String helloFacebook(Model model) { System.out.println("we are here!!!"); if (connectionRepository.findPrimaryConnection(Facebook.class) == null) { return "redirect:/connect/facebook"; } PagedList<Post> feed = facebook.feedOperations().getFeed(); model.addAttribute("feed", feed); return "hello"; } }

Funciona perfectamente, pero ¿cómo se autoconectan estos beans sin el @Autowired? ¿Están autocableados como un campo o en el constructor?

about 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Con Spring Boot 1.4+, los constructores se conectan automáticamente

https://docs.spring.io/spring-boot/docs/current/reference/html/using-boot-spring-beans-and-dependency-injection.html

about 4 years ago · Santiago Trujillo Report

0

En este controlador, no ha proporcionado ninguna anotación @Autowired y es posible que tenga la interfaz en el controlador, por lo que no necesita proporcionar la anotación y, además, verifique en la capa de servicio @La anotación de servicio está allí o no si no ha proporcionado @ Servicio que no puede usar @Autowired también.

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!