velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Colson \(tcolson\)" <tcol...@cisco.com>
Subject RE: Template as *Stream* ?
Date Mon, 11 Apr 2005 16:06:14 GMT

The Dev Guide has an example of using a String template:
http://jakarta.apache.org/velocity/developer-guide.html#Using%20Velocity
%20In%20General%20Applications
 
 /* lets make our own string to render */

        String s = "We are using $project $name to render this.";
        w = new StringWriter();
        Velocity.evaluate( context, w, "mystring", s );
        System.out.println(" string : " + w );


> -----Original Message-----
> From: Matthias Wessendorf [mailto:mwessendorf@pironet-ndh.com] 
> Sent: Monday, April 11, 2005 2:50 AM
> To: velocity-user@jakarta.apache.org
> Subject: Template as *Stream* ?
> 
> Hi,
> 
> I am testing Velocity and I have some templates on file.
> That works fine.
> 
> However is there a possibility to use a *stream*
> something like a String ?
> 
> getTemplate("Hello $name! Welcome to Velocity!");
> 
> instead of getTemplate("hello.vm");
> 
> 
> thanks,
> Matthias
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Mime
View raw message