Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Setter DI for the bean

 
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic