Springboot get the path of the resource

1, access to the resource directory path template
String path = Thread.currentThread().getContextClassLoader().getResource("").getPath()+"template";

 

Guess you like

Origin www.cnblogs.com/ywjfx/p/10944656.html