How to display an image to jsp page ? It does not allow me to display . I am using simple servlet application and I have mention the correct path so path is not the issue .
Provide the solution as soon as possible.
How to display an image to jsp page ? It does not allow me to display . I am using simple servlet application and I have mention the correct path so path is not the issue .
Provide the solution as soon as possible.
<img>
tag in HTML
or JSP
, will trigger a GET
request which the server has to handle.
EXAMPLE
if I have image like below
<img src="images?imageName=xyz.png"/>
the browser will request the servlet
on the server
with the name images
passing the parameter imageName and its value value
.
the servlet images
has to handle the request and send image information in the form of stream which gets back to the browser and be displayed on the page.
images is name given to a servlet
follow this thread for better understanding.
Thank you for support . Problem is solved.
The problem was :
I was trying to fetch the image file dynamically and was writing the height attribute so it was concatinate my src with height so I removed height and wrote before src attribute .
It Works .....