Java Web应用程序。定位图像时遇到的问题 [英] Java Web Application. Problems in locating images

查看:111
本文介绍了Java Web应用程序。定位图像时遇到的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个java web应用程序,我希望它能显示图像。但是,它没有找到我的图像。



我在 / src / main / resources / images $ b

另外,在 .jsp 文件中,我尝试了以下句子。

 < img src =/ src / main / resources / images / Head.png> < / IMG> 

< img src =< c:url value ='/ src / main / resources / images / Head.png'/>> < / IMG>

是否有什么不好的现象?



感谢

编辑:

mi .jsp file是 /src/main/webapp/WEB-INF/jsp/welcome.jsp



您可以在 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 /src/main/resources/images

Also, in the .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>

Is there anything bad I'm doing?

Thanks

Edit:

The path of mi .jsp file is /src/main/webapp/WEB-INF/jsp/welcome.jsp

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆