velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Fahrmeyer" <thomas.fahrme...@einsurance.de>
Subject AW: AW: Features are complete ?
Date Fri, 02 Feb 2001 09:32:24 GMT
Hi,

yeah it works in the way I expected and it seems that I can drop my own
class ;)

Here yet a little suggestion:
- Can add a parameter: templateName to the calls. If the templateName is
referenced in log-files, it's certainly useful if the app can set this name
at runtime.

- A more grained exception handling. Log Messages for ParseException and the
other exceptions which can be fired. (I know the code you provided is a
first snapshot ;)

Thanx for your fast response

Thomas

> -----Ursprungliche Nachricht-----
> Von: gmj@optonline.net [mailto:gmj@optonline.net]Im Auftrag von Geir
> Magnusson Jr.
> Gesendet: Donnerstag, 1. Februar 2001 20:48
> An: velocity-user@jakarta.apache.org
> Betreff: Re: AW: Features are complete ?
>
>
> Ok.  I just checked into the whiteboard a new class : Velocity.java
>
> To get it, update your CVS tree, or just use the online CVS browser to
> download a copy.
>
> NOTE : this should be dropped into your source tree in
> src/java/org/apache/velocity/util
>
> The point of this class is to become the application utility class. I
> hope that it might :
>
> 1) Be the interface to the velocity core, so we can wean application
> programmers from calling Runtime methods directly.  This would decouple
> the Velocity application API from the internal implementation, making
> life better for all.
>
> 2) providing both useful and interesting application-level utility
> functions that we want to support.
>
> Anyhow, Thomas et al, give the evaluate() function a try...
>
> I used it thus :
>
>   context.put("Floog", "floogie woogie");
>   context.put("name", "geir");
>
>   String stest = " My name is $name -> $Floog";
>   StringWriter w = new StringWriter();
>
>   Velocity.evaluate( context, w, stest );
>
>   System.out.println("Eval = " + w );
>
> let us know how it works...
>
> geir
>
>
> "Geir Magnusson Jr." wrote:
> >
> > Jon Stevens wrote:
> > >
> > > on 2/1/01 9:44 AM, "Thomas Fahrmeyer" <thomas.fahrmeyer@einsurance.de>
> > > wrote:
> > >
> > > > Hmm, I'm confused too ;))
> > > >
> > > > I got the nightly build (02/01/01) and can't find any
> > > > InputStreamTemplateLoader ;(
> > > >
> > > > It sounds as if that is what I want to have. I build
> something similar by
> > > > myself.
> > > >
> > > > bye
> > > > Thomas
> > >
> > > Exactly. I'm saying to you that that is the right way to
> implement such
> > > functionality. I'm not saying that it already exists.
> >
> > I'm not sure about this, y'all.  I think that as it's an application
> > type of thing that seems to be needed, then an application API type of
> > solution would be good.  What I mean by this is that he doesn't need any
> > of the 'infrastructure' to do this.
> >
> > I am testing now an eval() function in the Velocity helper class not to
> > be used in a template, but in the Java code w/o any real difficulty.
> >
> > it's   public boolean evaluate( Context, Writer, String)
> > or     public boolean evaluate( Context, Writer, InputStream)
> >
> > If I can remember to import correctly, I will have this in the
> > whiteboard in the next few minutes...
> >
> > --
> > Geir Magnusson Jr.                               geirm@optonline.com
> > Velocity : it's not just a good idea. It should be the law.
> > http://jakarta.apache.org/velocity
>
> --
> Geir Magnusson Jr.                               geirm@optonline.com
> Velocity : it's not just a good idea. It should be the law.
> http://jakarta.apache.org/velocity


Mime
View raw message