Thanks a lot! There's just a little typo:
OutputStreamWriter osw = new OutputStreamWriter(out);
Davor Hrg wrote:
>
> ByteArrayOutputStream out = new ByteArrayOutputStream();
> OutputStreamWriter osw = new OutputStreamWriter(System.out);
> velocityContext.put("desc", thi
ok,
what you will need is a datapump which converts an output stream to an
input stream.
See: http://ostermiller.org/convert_java_outputstream_inputstream.html
Method 1 is the simplest: let velocity write to abytearrayoutputstream
and use the byte array to construct an input stream object. voil
ByteArrayOutputStream out = new ByteArrayOutputStream();
OutputStreamWriter osw = new OutputStreamWriter(System.out);
velocityContext.put("desc", this.description);
template.merge(velocityContext, osw);
osw.flush();
osw.close();
return new Byt
The thing is that I don't know how to get my OutputStreamWriter into
InputStream so that StreamResponse is able to stream it to the user. This is
probably a very basic problem but I'm not very experienced with that.
Right now there is nothing streaming but writing to System.out. But I want
to do s
sure. if you post your streaming snippet we can take a look...
Hello,
I'm trying to stream a text file I created with Velocity very similar to the
way it is done
http://wiki.apache.org/tapestry/Tapestry5HowToCreateADynamicPDF here but it
doesn't work. The text is stored in a OutputStreamWriter