0
votes

I have a JSP page that has one image that is part of the JSP page but that image is not displayed when I view the webpage. I can view the webpage but it does not include the image.

I have my icons folder located in several places because I am trying to fix this problem.

this is my folder structure WebContent/icons/banner1.jpg

am also not able to view img.jpg directly from my web server. For example: //localhost:8080/school_management_sysytem/WebContent/banner1.jpg I get these errors.

Type - Status Report

Message - /School_mangement_System/icons/user-list.jsp

Description - The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

this is my code

 </div>
    <img src="/icons/banner1.jpg" height="100%" width="75%">

 </div>
1

1 Answers

1
votes

You can use ${pageContext.request.contextPath}

</div>
    <img src="${pageContext.request.contextPath}/icons/banner1.jpg" height="100%" width="75%">

 </div>