velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ed Yu" <e...@asgnet.psc.sc.edu>
Subject RE: Rendering an output stream?
Date Wed, 17 Jul 2002 18:31:41 GMT
I've contributed a #template macro, a week or so ago. If it is not in
the CVS, I'll send it to you.

-----Original Message-----
From: Jason Kary [mailto:jkary@cisco.com]
Sent: Wednesday, July 17, 2002 2:30 PM
To: Velocity Users List
Subject: Re: Rendering an output stream?


Geir,

Thanks for the code snippit!  So it seems relatively trivial to include 
a stream from a 'controller' standpoint.  I need to throw one more 
'kink' into the problem.  I am using the Velocity-Struts tools code.  I 
am not really excited about extending the VelocityViewServlet code, and 
I am wondering if I can access the template from the 'View' side of the 
program.  

Is it possible to do something like this?  Or am I going in the wrong 
direction?

I guess I am thinking along about a template as follows:

<pre>
<table>
    <tr>
        <td> File: $myFilename </td>
    </tr>
    <tr>
        <td>$myFileData</td>
    </tr>
</table>
</pre>

Just a quick example.  I hope it illustrates what I believe is the need 
to control 'where' we want the output stream to be put....


Thoughts?

Jason

Geir Magnusson Jr. wrote:

>On 7/17/02 10:18 AM, "Jason Kary" <jkary@cisco.com> wrote:
>
>  
>
>>Hi,
>>
>>I am trying to figure out how I can use velocity to render an
>>OutputStream class.  I don't really want to buffer the output from the
>>OutputStream into a 'holding' object.  This will require too much
memory.
>>
>>    
>>
>
>OutputStreamWriter osw = new OutputStreamWriter(outputStream);
>
>
> myTemplate.merge(ctx, osw);
>
>  
>




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


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


Mime
View raw message