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:
ResourceLoader resourceLoader = new DefaultResourceLoader();
Resource resource = resourceLoader.getResource("classpath:");//what dir use here?
ResourceLoader resourceLoader = new DefaultResourceLoader();
Resource resource = resourceLoader.getResource("classpath:");//what dir use here?
thanks for ur help fellas.
5 Replies
JavaBot
JavaBot6mo ago
This post has been reserved for your question.
Hey @bambyzas! Please use /close or the Close 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.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
JavaBot
JavaBot6mo ago
return new ClassPathResource(location.substring(CLASSPATH_URL_PREFIX.length()), getClassLoader());
return new ClassPathResource(location.substring(CLASSPATH_URL_PREFIX.length()), getClassLoader());
Peter Rader
Peter Rader6mo ago
Be aware that maven's call mvn tomcat:run will not use src/main/resources.
JavaBot
JavaBot6mo ago
Post Closed
This post has been closed by <@611623200756989972>.
Want results from more Discord servers?
Add your server