0

Trying to load an imager from my spring boot app, image is in webapp/images folder but the following does not find it:

 URLDataSource source = new URLDataSource(PrintToPdf.class.getResource("images/Elekdirect_Logo.jpg"));

also tried:

 url = ClassLoader.getSystemResource("images/Elekdirect_Logo.jpg");

But url is always null - so I'm taking it the file wasn't found.

Any advice is appreciated.

Thanks

Steve Green
  • 79
  • 1
  • 10
  • Does this answer your question? [Loading a file image in a war project](https://stackoverflow.com/questions/14043799/loading-a-file-image-in-a-war-project) – crizzis May 05 '21 at 15:52
  • Also, see here: https://stackoverflow.com/questions/15749192/how-do-i-load-a-file-from-resource-folder – crizzis May 05 '21 at 15:52

0 Answers0