Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Setter DI for the bean  RSS feed

 
sarma kiran
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Is is possible to provide setter Injection for the bean which has static factory method?

Actually i am trying for setter injection in the bean, its showing error " No setter method found for num in java.lang.String" in configuaration file.

Can any one help me?




Regards,
Kiran

 
Hong Anderson
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is because java.lang.String has no num attribute.
Change public static String createInstance() to public static BeanStaticDemo createInstance().
 
sarma kiran
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!