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

前端 未结 2 1895
独厮守ぢ
独厮守ぢ 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:32

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

    @Value("classpath*:../../cssDir/*.css")
    private Resource[] cssFiles;
    

提交回复
热议问题