velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Travis Low <>
Subject Re: Appearance of undefined references
Date Mon, 25 Sep 2000 00:43:13 GMT
Jon Stevens wrote:
> If you do this:
> <input type="text" name="email" value="
> #if ($email) { $email }
> ">
> You get empty spaces where the block of WM code is, which is even worse
> because someone could potentially submit that and have it become the real
> value in the database.
> Anyway, this is really tripping me up with my Scarab development and I'm not
> sure how anyone else has put up with this in WM for so long. :-(

Indeed.  I think it makes more sense to emit an empty string for undefined or
null references.  You don't need a log entry or an HTML comment to tell you that
the email is blank -- it's staring you in the face.  So you go to the
appropriate part of your code and say "Oh, I forgot to put email in the
webcontext", and you fix it.  Case closed.

And, might I add, that's how Freemarker handles it.  But you knew I was going to
say that.  :-)

-- Travis Low  

View raw message