使用autowire属性可以实现自动注入,可以取值:byName和byType。
简单示例代码:
<bean id="registerAction" class="com.lantsky.action.RegisterAction" scope="prototype">
  
<property name="userManageService">
    
<ref bean="userManageService"/>
  
</property>
</bean>


可以写成:

 

<bean id="registerAction" class="com.lantsky.action.RegisterAction" scope="prototype" autowire="byName"/>


 

相关文章:

  • 2022-01-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-30
  • 2021-04-07
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-26
  • 2022-01-19
  • 2022-12-23
  • 2022-01-20
  • 2022-03-03
相关资源
相似解决方案