How to use Spring ClassPathResource: with classpath: or classpath*: and leading / or not?

前端 未结 1 1048
旧巷少年郎
旧巷少年郎 2021-01-04 07:31

I having file in the location

--src
  --> main
   --> config
    --> application
     --> context
      --> reference
       --> user
              


        
相关标签:
1条回答
  • 2021-01-04 07:52

    Use as below

    Resource resource = new ClassPathResource("/application/context/references/user/user.xml");
    File file = resource.getFile();
    
    0 讨论(0)
提交回复
热议问题