Art Gillespie wrote:
>
> I think the option of having the template print error messages to
> the write when merge is called is a fantastic idea. However,
> this should (at the very least) be a debug switch somewhere in the configuration.
>During
> development, this feature would be muy useful, but if it happens
> in production, I'd rather handle the Exception programmatically
> and pore through velocity.log.
Hm. I will have to say I respectfully disagree on the fantastic-ness of
that idea :)
It's very easy to write a little custom logging class which your app can
instantiate and hand to Velocity - then you can put your messages where
you want to. This wouldn't intermigle them, but you could easily write
the log messages out after the render stream....
geir
>
> Also, if I read the spec correctly, shouldn't the parser just
> ignore $2 and write it out as a string literal? Why is it
> throwing exceptions at all?
>
> --Art
>
> --Since time is infinite, and life is finite, the probability
> that I exist is zero.
>
> On Thu, Mar 29, 2001 at 02:33:31PM -0800, Joshua Levy wrote:
> >
> > This is a different experiment in avoiding HTML. It
> > may not work. I'll know if it doesn't, so there is no
> > need to tell me....
> >
> > > you mean a reference called
> > >
> > > $2d6?
> > >
> > > Because references must start with a letter.
> > >
> > > From the VTL reference guide : [deleted]
> >
> > You missed my main points. I know (now) that it is
> > illegal. My points were: 1. the top exception said
> > that it could not find a template, when in fact, there
> > was a syntax error in the template. 2. WHY should
> > identifiers be limited to starting with a letter?
> > Since they can be lexically known by the $ at the
> > start, why not let $2d6 be legal?
> >
> > > > BTW: I like the idea of a template returning ...
> > > > [deleted for brevity]
> > >
> > > ?
> >
> > Let me try again. Lets say you put a syntax error
> > in a template. Something like $2. Right now what
> > will happen:
> > 1a. Can't find a template exception (with a more
> > descriptive exception down the stack).
> > 2a. getTemplate() returns NULL.
> > 3a. Text message in velocity.log
> > My suggestion is these things happen:
> > 1b. The top level exception should be the more
> > descriptive syntax error, not the "can't find
> > template" error.
> > 2b. getTemplate() returns a template which, when
> > used, will always generate the text string
> > description of the syntax error in the template.
> > 3b. Text message in the log file doesn't hurt anything,
> > but now, almost no one will use it, because the
> > error message came out when they tried to use the
> > template.
> >
> > Joshua
> ---end quoted text---
>
> ------------------------------------------------------------------------
> Part 1.2Type: application/pgp-signature
--
Geir Magnusson Jr. [EMAIL PROTECTED]
Developing for the web? See http://jakarta.apache.org/velocity/