Hi, I have a servlet which gets an image from an remote servlet through an URL request and stores that image in the form of an byte array. The servlet writes this image byte array directly to the response stream which displays the image properly in the browser. Now I want to send some text with the image as a response, I tried to append the text to the same byte array in which the image is stored but in this case neither image nor text is getting printed. Is there any way by which I can combine my image and text together in the form of byte array and write it into the response stream.
If any body has any idea or reference links please send me
No the client here wont be sending two request like one for image and one for text instead it will be a single request but my servlet should hit another two servlets.
Suppose Servlet1 (which is my servlet) makes two HttpURL connections to different servlets in which one returns an image and one returns a text now I have to combine both image and text into a single byte array and have to send back to client. If you know any tricks and strategies to implement it please suggest.
I tried to attach an image which displays the scenario but i was not able to do it or as i am new to this forum i dont know how to paste an image
"Sandeep K.M/sansandy", you have been warned on multiple occasions in this and your other post regarding adjusting your display name to meet JavaRanch standards. This is not optional, and this is your final warning. Adjust your display name to comply with the required standards prior to your next post.
Again, your display name must be a first name and a last name. First names only are not allowed, nor are initials for your last name.
Failure to comply will result in the removal of your account.