Inject files as list of resources using wildcard by annotations in Spring

前端 未结 2 1872
独厮守ぢ
独厮守ぢ 2021-01-12 07:32

I have a class which I use as a spring bean. The bean is defined in the applicationContext.xml like:



        
相关标签:
2条回答
  • 2021-01-12 08:29

    For application.properties (yml) approach:

    someFiles=file:/some/path/*.someExtension
    
    0 讨论(0)
  • 2021-01-12 08:32

    Try the following, if you're willing to use an array instead of a List:

    @Value("classpath*:../../cssDir/*.css")
    private Resource[] cssFiles;
    
    0 讨论(0)
提交回复
热议问题