Velocity is a templating language and as such only works with strings. I believe to handle images, you need to have the HTML tag <IMG ...>
Within this HTML, you can use Velocity to build the string reference to the image. For example, <IMG SRC="${baseurl}/images/myimage.gif"> Otherwise, you could create a servlet that takes some information, gets the binary data and serves up the image. Velocity could help to build the URL reference. For example: <IMG SRC="${imageHandlerURL}&user=$userid"> If this is not a web application, then this won't work, but might give you some ideas. Velocity itself changes every reference to a String as it parses, so passing binary data to Velocity for interpreation will not be useful. Barbara Baughman X2157 On Mon, 28 Nov 2005, Antony Bourgois wrote: > Hi > > I have image data from a byte array I need to populate (append in > fact) into a template. > > I've come across iterating thru the data with > #foreach( $i in $array ) > $i > #end > > ... but don't get the result I'd get by appending the binary data > right after the merged template. > > I'm using a Spring MVC VelocityView and only want this data array > passed into the context and rendered as binary (no post merge > appending). > > How can I handle this? > If a previous post already mentions the solution, I'd appreciate your > passing it on. > > Appreciated! > > Antony B. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]