Get image from relative path

前端 未结 8 1902
囚心锁ツ
囚心锁ツ 2021-02-03 13:01

In my project I have 2 packages. images - contain images and notification - contain java files

In notification/main.java I get Image o

8条回答
  •  孤街浪徒
    2021-02-03 13:13

    / means an absolute path, save Java web-apps where / means relative to context. So, I would suggest to use relative URL, means get rid of that / in front, and then provide the right path.

    In case, even then you can't solve it, try to create a file on the same path you are looking for image. This way you will know that where you are looking exactly and where you should look.

提交回复
热议问题