mardi 28 août 2018

Diplaying images in a java web project

So, i'm trying to do something simple: Display an image in my java web app.

I built a simple app for that, but i'm not succeeding, I tried all different I could find but no success.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>test page</title>
</head>

<body>
    <h1>testing internal libraries</h1>
    <img src="<%= request.getContextPath()%>/WebContent/images/cp.jpg" width=30 />
    <img src="<%= request.getContextPath()%>/images/cp.jpg" width=30 />
    <img src="../images/cp.jpg" width=30 />
    <img src="images/cp.jpg" width=30 />
</body>

</html>

enter image description here

enter image description here




Aucun commentaire:

Enregistrer un commentaire