In my application, I would like to display the page as it is rendered with template.merge(), but also display error messages in a popup window.
A suggestion would be to set up a specific Writer for this task that can be either the log or the servlet output. We need a process to get the detailed error from the application.
-----Original Message-----
From: Art Gillespie [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 29, 2001 3:02 PM
To: [EMAIL PROTECTED]
Subject: Re: more nits to pick
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.
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---
