tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Ross <r...@cgl.ucsf.edu>
Subject loading images through a Servlet
Date Thu, 01 Oct 2015 21:52:59 GMT
Please let me know if there is a better place to ask Servlet/javascript 
interface questions.

I have a slide show web page that does the logical equivalent of:

     var img = new Image();
     img.src = "/images/" + /servlet/getnextfile(params)
     img.[onload]: document["image"].src = img.src; resizeImage();

Rather than using the 'getnextfile' servlet to get a file name and then 
load it, I would like to have getnextfile return a stream of bytes from 
the database which seems feasible (streaming a BLOB I assume), but I 
don't know how to receive that into an Image (which wouldn't have 'src' 
set - ?).

One motivation is to reduce the round trips to the server for faster 
response time.
Another motivation is to keep the filename from the user.

Thanks,
Bill

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message