09-21-05 10:55 PM
Thank you Michael, it make sense the way you explained it. Incase you are wo
ndering I ended up creating a servlet that would server the images out as yo
u sugguest and it has been working great. Thank you very much for the help.
L
Search this newsgroups for other questions like this. It has been
answered many times.
You can't output the bytes of the graphics from the portlet. You have
to have some other mechanism (such as a servlet packaged with the
portlet inside it's .war file) to serve up the bytes of the graphic.
Remember, portlet output is aggregated. The output of your portlet is
combined with the output of other portlets on the page and the themes
and skins to build an entire page. When the browser requests a graphic,
it expects not only the correct mime type, but also the bytes of the
graphic and nothing else in the HTTP stream.
Think about it for a minute. Even if you were to code a portlet such
that it could write out the bytes of a graphic, when the browser calls
the URL to get the bytes, it's going to get a bunch of bytes in the
wrong format because what it thinks are the first few bytes of the
graphic will actually be the HTML markup output from the themes and
skins. Within the first couple of bytes or so, the browser will realize
that the bytes aren't a graphic and will throw the data away. You can't
mix HTML and binary graphic data together in the same stream and expect
the browser to figure out the right thing to do.
[ Post a follow-up to this message ]
|