AnsweredAssumed Answered

Injecting bean into custom Java class

Question asked by soloff on Jun 25, 2016
I know how to inject bean into Java web script. It's quite simple:

<bean id="webscript.ru.mycompany.maypackage.myclass.get"
   class="ru.mycompany.maypackage.myclass"
   parent="webscript">            
   <property name="properties">
             <ref bean="global-properties"/>
   </property>
</bean>


But it's not working for custom java class, variable <strong>properties is null</strong> :(

<bean id="myclass"
   class="ru.mycompany.maypackage.myclass">            
   <property name="properties">
             <ref bean="global-properties"/>
   </property>
</bean>

public class myclass
{
   private Properties properties;
   
   public myclass()
   {
      
   }
   
   public void setProperties(Properties properties)
   {
      this.properties = properties;      
   }
}

<strong> What should I do?</strong>

Outcomes