How to give Servlet response from Tag Handler class?
sagar gangipamula
Greenhorn
Joined: Dec 19, 2008
Posts: 3
posted
0
How to give servlet response form the dotag() method in which i am retrieving image from database and i have to display it on jsp page where i am calling this tag.
Hello and welcome to JavaRanch. To help you I would say use the UBB code to post your source code.You can edit your code and make it more readable and for more responses to flow in for your question.
Originally posted by Ulf Dittmer: You can't. JSPs (and thus also JSP tags) are for creating text, not for streaming binary data. You will need to use a servlet to do this.
thank Q , i put that code in servlet then can i call that servlet in dotag() using the attribute src.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35241
7
posted
0
It sounds like you are trying to somehow embed an image in a web page - that is not going to work. You need to write an <img> tag into the web page, and the src attribute of that img tag then points to a servlet that serves the raw image data.