i am using this method
<IMG SRC="basic.jsp">
for showing image in img tag this method work fine in tomcat but in weblogic server it is giving following error :
The image “view-source:https://10.189.65.201:7003/UploadImg/getImage.jsp” cannot be displayed because it contains errors.
i know if i use Servlet with doGet() method instead a JSP psge it will work fine but why it is not working in this way is there any settings issue?
Any whitespace outside
<% ... %>in the JSP file will also be printed and sent to the HTTP response.So if you have e.g.
then effectively 2 newlines will also be sent to the reponse. This corrupts the binary format of the image.
You’d basically need to replace it by
to prevent those newlines being printed to the response (and make sure that there’s no trailing newline, either).
Or, better, just use a servlet. JSP is meant to generate text based content like HTML, not binary based content like images. Something with using the right tool for the job.