Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy doesn't my image show in a jsp? [confused]
    primarykey
    data
    text
    <p>I'm new to Spring MVC and the Spring framework in general and I'm trying to learn it.</p> <p>I did a small "hello world" project using the Spring Tool Suite and encountered a strange issue. So I started a new Spring Project and chose Spring MVC Project. I created a controller and a view jsp page to display a hello page. All is working fine. There is no problem here. Then I decided to include a picture in my jsp page. I copied a picture to the "webapp/resources" folder and put an img tag like this in my view page (whose path is "webapp/WEB-INF/views/hello.jsp"). The tag looks like this :</p> <p></p> <p>When I run the application and go to my view page it doesn't show the image in STS internal browser or in my regular browser. I tried to view the source of the page from my browser and the source does have the img tag but for some reason it's not shown.</p> <p>I tried to put the image directly in "webapp/WEB-INF/views" along with my jsp file and changed the tag to this:</p> <p></p> <p>but still no success. Finally, I blamed this on my inexpirience with creating jsp's and tried to open up my regular Eclipse IDE (i.e. one different from STS) and created a Dynamic Web Project where I inserted the tag into a jsp file and copied the picture in one of the project's subfolders. I ran the project and now it works ; the picture is shown.</p> <p>Why is happening this? Why it works in a regular web project and doesn't work in a Spring MVC Project? Thank you for your time and I appreciate if you help me! </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload