A
Antti Nummiaho
I am trying to set the source (src) of a html <img> tag to a string
returned from a jsp page. So far without success. A simplified example
follows.
Example.html:
<html>
<head></head>
<body>
<script language="JavaScript" type="text/JavaScript">
document.writeln("<img src='Foo.jsp'>")
</script>
</body>
</html>
Foo.jsp:
<%@page contentType="text/html"%>
bar.png
The web browser (IE) sets the img src to the url of the jsp page (i.e.
http://localhost:8080/temp/foo.jsp) instead of the "bar.png" which the
jsp page returns (actually because of the contentType row, the jsp
page returns "\r\nbar.png" for some reason, but this is not the
problem since it does not help even if the contentType row is left
out).
So the question is how should the Example.html and Foo.jsp pages be
defined to get the html page to display the bar.png image or is it
even possible?
returned from a jsp page. So far without success. A simplified example
follows.
Example.html:
<html>
<head></head>
<body>
<script language="JavaScript" type="text/JavaScript">
document.writeln("<img src='Foo.jsp'>")
</script>
</body>
</html>
Foo.jsp:
<%@page contentType="text/html"%>
bar.png
The web browser (IE) sets the img src to the url of the jsp page (i.e.
http://localhost:8080/temp/foo.jsp) instead of the "bar.png" which the
jsp page returns (actually because of the contentType row, the jsp
page returns "\r\nbar.png" for some reason, but this is not the
problem since it does not help even if the contentType row is left
out).
So the question is how should the Example.html and Foo.jsp pages be
defined to get the html page to display the bar.png image or is it
even possible?