xml中配置BEAN与参数

<bean >2</prop>

      ......
            </props>
        </property>
    </bean>

bean类中添加setting 属性:

public void setConfig(Configuration configuration){

String param1= configuration.getString("param1");//这里就取到了参数值

}

相当于把spring 整合了properties文件的配置方法,减轻了自己解析加载的过程。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-01
  • 2021-09-03
  • 2021-12-25
  • 2022-12-23
  • 2022-12-23
  • 2021-06-06
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-13
  • 2022-12-23
相关资源
相似解决方案