Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

161
Visualizações
Spring inner bean instantiation

first of all please refer to this tutorial i've been reading.

Spring Injecting Inner Bean

I've been following that tutorial because it seems much easier to understand than other tutorials and guides over the internet.

So i am having trouble grasping the concept of inner bean here. It was not explicitly indicated on that tutorial (or i must've miss something on spring docus). So do please point me or explain to me the following;

1.) In TextEditor.java, it has a method setSpellChecker(SpellChecker spellChecker), and looking at the final output it displayed 3 messages. Particulalry "Inside setSpellChecker.", How was it displayed where in fact SpellChecker class has no constructor, its a setter method. does this mean upon setting of property spellChecker, setter method was called?

Disclaimer: I am new to spring and even though there is a documentation on spring site. I can't consume them all and expect that i will know all of its concept so i learn by doing and testing stuff. And this is one of those time im stuck and can't move on. wanted to learn in step by step before i go do advance stuff.

UPDATES - modified the question, i've reading it over and over again. see new question

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

"Inside setSpellChecker." is printed because spellChecker bean is injected into TextEditor using setter injection as <property> tag is used in Beans.xml.

Below steps are executed to create bean of TextEditor.

  1. Create instance of spellChecker (inner bean) so it prints 'Inside SpellChecker constructor.`
  2. Set spellChecker bean into TextEditor using TextEditor.setSpellChecker() as we are using setter injection.When TextEditor.setSpellChecker() gets called, it prints "Inside setSpellChecker" and assigns spellChecker TextEditor.spellChecker.

More on setter injection.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda