Re: Display raw image - given byte[]?

Mathew Rowley <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <C6FA7306.1168A%[email protected]>
I came across this tutorial:

http://www.conandalton.net/2008/10/sending-binary-data-from-freemarker.html

It uses freemarker to call a method that writes to the default stream.  Is
there any security ramification to have the template being able to access
the HttpServletRespones object? Are there any other issues with doing as the
tutorial describes?  Thanks.

MAT


On 10/13/09 2:44 PM, "Daniel Dekany" <[email protected]> wrote:

> Tuesday, October 13, 2009, 9:29:47 PM, Mathew Rowley wrote:
> 
>> > I have an interface that returns an image in the form Œbyte[]¹.  Is
>> > it possible to create a ftl that ³writes² that image out to the user
>> > ­ setting the header to image/png, etc?  Thanks.
> 
> Nope... FreeMarker has no control over the MIME-type or over the
> output charset (which should be ISO-8859-1 if you want to keep the
> bits); the embedding framework has. Even then, it would be quite
> inefficient due to FreeMarker uses 16 bit char-s (UNICODE) internally.
> Last not least, it would be a miss-use of FreeMarker.
> 
>> > MAT
> --
> Best regards,
>  Daniel Dekany
> 
>

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference

_______________________________________________
FreeMarker-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freemarker-user
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.