Suresh M Sidy
Suresh M Sidy

Reputation: 113

Image source is not found in my JSP page. Getting 404 page not found in browser console

I know there is some mistake I'm making but I can't figure out what it is. Please help me out.

This is my project folder structure.

This is my project folder structure

I tried below -

  1. background="<%=request.getContextPath()%>/images/backgroundImage.jpg"

  2. background="images/backgroundImage.jpg" for body tag.

  3. I tried that css url also.

I'm getting same error in my browser console. Browser console error

What am I doing wrong?

Upvotes: 0

Views: 726

Answers (1)

Avijit Barua
Avijit Barua

Reputation: 3086

Man I will suggest you to create a folder resources under webcontent. Put all your images inside there. Then in your jsp page map that image like

<img src="/resources/backgroundImage.jpg"" alt="View" style="width:304px;height:228px;">

Upvotes: 2

Related Questions