WildFly - getting resource from WAR

后端 未结 7 745
既然无缘
既然无缘 2020-12-21 00:13

I am using the following method to get a resource from WAR file in WildFly:

this.getClass().getResource(relativePath)

It works when the app

7条回答
  •  忘掉有多难
    2020-12-21 00:53

    I decided so:

    @Autowired
    private final ApplicationContext ctx;
    private final Path path = Paths.get("testfiles/load")
    
    ctx.getRosource("classpath:" + path);
    

提交回复
热议问题