how to use resource in resourceloader?
hey guys. i have an xml in this dir:
src/main/resources/communicationTestRequestBody.xml
and i dont know how to specify the dir:
thanks for ur help fellas.5 Replies
⌛
This post has been reserved for your question.
Hey @bambyzas! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
FWIMC As you can see here: https://github.com/spring-projects/spring-framework/blob/d76f37c90b334e71860524f81e79dfeda6068ed6/spring-core/src/main/java/org/springframework/core/io/DefaultResourceLoader.java#L160 The ClassPathResource is used. Then https://github.com/spring-projects/spring-framework/blob/d76f37c90b334e71860524f81e79dfeda6068ed6/spring-core/src/main/java/org/springframework/core/io/ClassPathResource.java#L209C26-L209C45 is used.
So Try:
.getResource("classpath:/communicationTestRequestBody.xml");
Be aware that maven's call
mvn tomcat:run
will not use src/main/resources.Post Closed
This post has been closed by <@611623200756989972>.