Java Web应用程序。定位图像时遇到的问题 [英] Java Web Application. Problems in locating images
问题描述
我正在制作一个java web应用程序,我希望它能显示图像。但是,它没有找到我的图像。
我在 另外,在 是否有什么不好的现象? 感谢 编辑: mi 您可以在 https://github.com/Santi-7/hello 您的应用程序是 Spring Boot应用程序。我认为你也可以尝试使用Spring Boot提供的工具来提供静态内容。无论如何,你现在正在做它,因为你正在使用 webjars 用于css和js库!与您使用的技术保持一致。 I'm making a java web app, and I want it to display an image. However, it doesn´t find my image. I've made a folder in Also, in the Is there anything bad I'm doing? Thanks Edit: The path of mi You can find the web app code in https://github.com/Santi-7/hello Your app is a Spring Boot app. I think that you can also try to use the facilities provided by Spring Boot for serving static content. Anyway, you are doing it right now because you are using webjars for css and js libs!!! Be consistent with the tech that you are using. 这篇关于Java Web应用程序。定位图像时遇到的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! / src / main / resources / images $ c中创建了一个文件夹$ c
$ b .jsp
文件中,我尝试了以下句子。
< img src =/ src / main / resources / images / Head.png> < / IMG>
< img src =< c:url value ='/ src / main / resources / images / Head.png'/>> < / IMG>
.jsp
file是
/src/main/webapp/WEB-INF/jsp/welcome.jsp
/src/main/resources/images
.jsp
file, I´ve tried with the following sentences. <img src="/src/main/resources/images/Head.png"> </img>
<img src="< c:url value='/src/main/resources/images/Head.png'/>"> </img>
.jsp
file is /src/main/webapp/WEB-INF/jsp/welcome.jsp