PDA

View Full Version : How to serve images from DB to be used in SRC attribute


2devnull
08-18-2004, 02:53 PM
How to serve images from DB to be used in SRC attribute in the <IMG tag? Is there a controller or a way that does not forward to a view but acts as a regular servlet writing the binary data from the DB to the output stream :?:

davison
08-18-2004, 04:38 PM
your controller can handle a response directly any way you choose. Return null instead of a ModelAndView and the Dispatcher will understand.

2devnull
08-18-2004, 04:41 PM
Ahhhh....great. I will try that

Jurgen
05-29-2006, 03:46 PM
Hi could you guys show us a workign example?

thx

irbouho
05-29-2006, 06:51 PM
You may review the imagedb sample from the spring main distribution ImageController#streamImageContent(). (http://springframework.cvs.sourceforge.net/springframework/spring/samples/imagedb/src/org/springframework/samples/imagedb/web/ImageController.java?view=markup)

HTH.