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

261
Views
Especifique @Bean predeterminado sin usar @Primary Spring Boot

tener un frijol como este:

 @Bean TemplateEngine myTemplateEngine() {...}

Pero Spring boot también tiene un bean para TemplateEngine definido en:

org/springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfiguration$ThymeleafDefaultConfiguration.class

Cuando conecto automáticamente TemplateEngine obtengo

"El campo requería un solo frijol, pero se encontraron 2"

Quiero que el bean de arranque de primavera sea el predeterminado y solo use mi bean si se especifica explícitamente, por lo que no pude usar la anotación @Primary porque no tengo acceso a esa definición de bean.

Además, me gustaría evitar usar la configuración xml también.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Intenta definir tu bean como

 @Bean @ConditionalOnMissingBean(TemplateEngine .class) TemplateEngine myTemplateEngine() {...}
over 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!