You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by Long Zhao <LZ...@firstgenetic.net> on 2003/05/05 17:42:43 UTC
newbie question
Hi all,
I know I can get a template from a file name by calling Velocity.getTemplate(templateFileName).
But can I get a template from byte[] or steam? since I have the template stored in database as a blob.
Thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org
Re: newbie question
Posted by Daniel Rall <dl...@finemaltcoding.com>.
"Long Zhao" <LZ...@firstgenetic.net> writes:
> Hi all,
>
> I know I can get a template from a file name by calling Velocity.getTemplate(templateFileName).
>
> But can I get a template from byte[] or steam? since I have the template stored in database as a blob.
Sure you can. You'll want to implement your own ResourceLoader by
sub-classing this class:
velocity/src/java/org/apache/velocity/runtime/resource/loader/ResourceLoader.java
--
Daniel Rall
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org