How to scan multiple paths using the @ComponentScan annotation?

前端 未结 8 1102
执笔经年
执笔经年 2020-11-29 17:38

I\'m using Spring 3.1 and bootstrapping an application using the @Configuration and @ComponentScan attributes.

The actual start is done wit

8条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-29 17:41

    You can also use @ComponentScans annotation:

    @ComponentScans(value = { @ComponentScan("com.my.package.first"),
                              @ComponentScan("com.my.package.second") })
    

提交回复
热议问题