views:

33

answers:

1

Wanting to do some fancy stuff... :P We'd like to be able to pass a string that IS the file, instead of a string that simple a filename.

We're going to create a file in memory using a string/stringbuffer and we want the velocity engine to act upon that instead of reading in a file.

Does this function exist?

Many thanks!

+2  A: 

We added a StringResourceLoader in 1.5 and made it better in 1.6. No need to implement your own.

http://velocity.apache.org/engine/releases/velocity-1.6.4/apidocs/org/apache/velocity/runtime/resource/loader/StringResourceLoader.html

Nathan Bubna