找不到错误 - 图像路径

时间:2018-02-15 14:56:34

标签: html spring angular image

我在我的应用中使用Spring和Angular2。但我的图片没有显示在HTML中,我收到此错误

  

获取here 404(未找到)

我的根目录是kongres-spring,src在其中,其他文件夹结构与路径相同,图像存在于文件夹中。那么,为什么我的照片没有显示出来?

1 个答案:

答案 0 :(得分:0)

如果您使用标准的春季启动项目并添加图片:

src/
src/main
src/main/java
src/main/java/hello
src/main/java/hello/HelloController.java
src/main/java/hello/Application.java
src/main/resources
src/main/resources/static
src/main/resources/static/images
src/main/resources/static/images/test.jpeg
src/test
src/test/java
src/test/java/hello
src/test/java/hello/HelloControllerTest.java
src/test/java/hello/HelloControllerIT.java

他们将在

上市
http://localhost:8080/images/test.jpeg

请参阅文档here

相关问题