velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ahmed Mohombe <>
Subject Re: Best practice for escaping?
Date Fri, 28 Oct 2005 15:48:51 GMT
> These two techniques are what I've used to write templates that
> generate other velocity templates.   As Ahmed says, it makes the code
> hard to read, but there aren't any better options in Velocity yet.
That's why the pragmatic(but ugly) solution at the moment is to use another
template language/engine(that won't interfere with the syntax from Velocity).

> In the Objective C templating engine I used before Velocity, it was
> handled by changing the starting and ending delimiters.   Ie, instead
> of #{if}, you'd change the delimiters to <*if*>.
Well that's an interesting approach.

> Velocity doesn't currently support changing delimiters (or even
> starting/ending delimiters for directives), 
Are there any plans for the future to support this type of 'changing' in Velocity?

> so you'll have to use
> something else if you aren't willing to live with escaping all # and $
> symbols.    
Well, personally I could live with them. Unfortunately, those escaping rules are too much
'simple users'. As I mentioned, some of the templates will be maintained/created
by them.

> While maintaining such templates is a nightmare, creating
> them initially isn't a big deal since you can just do a global find
> and replace of both symbols.
Well, yes, but I'm not sure if simple users can do the same. Also a big problem
are the 'errors' in the templates: while a programmer can live with them by debugging or by

searching very quickly the source of the problem, simple users just 'blame the system'.

Thanks in advance,


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message