Hi all,

I'm tinkering with a java, non-blocking, HTTP server implementation
and am considering tweaking Velocity (because of its
container-agnostic design) so that I can use it's output in such an
environment.

Specifically, instead of having the Velocity Template "merge" its
output to a Writer, I want to create a Template that "merges" output
to something like a java.util.List<java.nio.ByteBuffer>.

The purpose of this modified output would be to ultimately pass (it in
the form of a ByteBuffer array) as the argument to a
java.nio.channels.SocketChannel.write -- a non-blocking "gathering"
operation.

The idea with the java.util.List<java.nio.ByteBuffer> is that the
content of some ByteBuffers will be dynamically generated; the
contents of the rest would be static.

So how to pull this off?  The first place I considered hacking was the
Template class itself (something like intercepting every ASTText
instance's render method for static content and doing something else
with the dynamic bits of content).  Needless to say, this has a
'hacky' feel to it ;)  And since I'm new to Velocity, I'm thinking
maybe there's a more elegant approach.

And ideas?

Kind regards,
-Babak

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to