Hi all,
My problem is I want to write the character text as well as the binary data to the client in a single
servlet.
I have the images in the database.I want to organize the image with in a table and then send to the client.For writing binary data to the client we need
ServletOutputStream object which can be obtained by calling
response.getOutputStream() method,moreover the content type should be set as either
Then how to send the html to the client i.e the HTML code required to organize the binary data with in a table.For this we need to set the content type as response.setContentType("text/html") and a PrintWriter object is needed to write the character text.If I add the follwing code
with in the same servlet in which the binary data is sent to the client automatically the error occurs.
So what is the solution?