Load Image From Servlet With Ajax?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Alfred_Sung
Posted On:   Monday, March 20, 2006 04:52 PM

Hi,


I know that you can send and receive xml from a servlet using Ajax. But is there a way to have images sent from a servlet to the client and be displayed in an img tag? if so, can someone point me to an example?


Thanks,

Alfred

Re: Load Image From Servlet With Ajax?

Posted By:   Anonymous  
Posted On:   Tuesday, April 25, 2006 12:50 AM

I dont think you can do that. Browser handles fetching & rendering of images with img tag. If to handle images generated by a servlet you can return the url to the image as ajax response and set that to image tag href attribute. And the browser will load it.

Or use SVG, where you can pass image data/co-ordinates as ajax response, and use them to draw on the browser.
About | Sitemap | Contact