我是 Spring 注释的新手。
我有以下 YAML 配置:
configLists: - listItem1 - listItem2mainConfig: listItem1: listingName: listItem1 property1: testing-value-1 property2: testing-value-2 storageprop: example/storage/loc-2 listItem2: listingName: listItem2 property1: testing-value-1 property2: testing-value-2 storageprop: example/storage/loc-2
在 Spring Annotations 和配置的帮助下,我想动态地创建类。即由于在 mainConfig listItem1 和 listItem2 下有两个配置,因此应用程序应仅在单个类的帮助下创建两个实例。
如何在 Spring Boot 应用程序中使用 @Bean、@Configuration 和其他注解?
是否可以在创建实例时将运行时的配置传递给类?
对此的任何帮助表示赞赏。
谢谢,
阿维纳什·德什穆赫
慕桂英3389331
相关分类