Website image path problem: Absolute path and virtual path

  • 2020-06-07 05:09:23
  • OfStack

First of all, images and projects are not under one tray. Pictures can't be placed under projects.

In the JSP file < img src="C:/Users/fx/Pictures/test.jpg"/ > You're not going to get a picture. Because when quoting images on JSP page, the path of page resolution is as follows: < img src="http://localhost:8080/test/images/1.jpg" > . This means that JSP quotes images from your project directory first.

So if you want to introduce images with other disk characters in JSP, you can only configure the virtual path.

Related articles: