[jboss-user] [Microcontainer] - Re: directly injecting a bean in a property

jaikiran do-not-reply at jboss.com
Wed Mar 25 02:33:42 EDT 2009


Works fine for me:

<?xml version="1.0" encoding="UTF-8"?>
  | <deployment xmlns="urn:jboss:bean-deployer:2.0">
  | 
  |     <bean name="test" class="org.myapp.test.TestBean">
  |         <property name="name">
  |             <bean name="somestring" class="java.lang.String"/>
  |         </property>
  |     </bean>
  | </deployment>
  | 

  | public class TestBean
  | {
  | 
  |    private String name;
  | 
  |    public String getName()
  |    {
  |       return name;
  |    }
  | 
  |    public void setName(String name)
  |    {
  |       System.out.println("Setting name in testbean" + name);
  |       this.name = name;
  |       
  |    }
  |    
  |    
  | }
  | 

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4220805#4220805

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4220805



More information about the jboss-user mailing list