> From: Jon Stevens [mailto:[EMAIL PROTECTED]]
> 
> on 12/1/2000 2:09 PM, "Jose  Alberto Fernandez" 
> <[EMAIL PROTECTED]>
> wrote:
> 
> > Well, I could argue that the need for encoding is part of 
> the View and
> > not of the model or the controler. In other words, if I 
> where in need to
> > generate some other text format, which I can do using Vel, 
> I should not
> > need to change my model. I would expect I can use 
> "$x.getFieldwithText()"
> > and this time getting not escaped output.
> 
> Ok, so then what is wrong with:
> 
> $escape.getText($x.getFieldWithText())
> 
> You just went full circle on yourself dude.
> 

I never, said that these approach wasn't clean. What I was
advocating for was a way to make things more convinient for
users. By allowing some of these repetitive things to be done
by the Vel engine instead of requiring manual action.

> :-)
> 
> > True, but what I am suggesting is that only 
> "variable"/"method" output
> > be filtered. Not the template itself (the argument being 
> that template
> > encoding is for the writer of the template to do).
> > 
...
> > So what do you think, what I am asking is a definition and way
> > to set this filter interfaces, it is up to the developer to provide
> > the smarts required by it.
> 
> You can do all of that without any modifications to Velocity.
> 

Can I? Can you give me some hints where to look at examples?

> > public class XMLFilter implements Filter
> > {
> > private boolean off = false;
> > 
> > public String process(String in) { //Filter interface
> > if (off) return in;
> > return Escape.getText(in);
> > }
> > 
> > public void turnOn() { off = false; }
> > public void turnOff() { off = true; }
> > }
> 
> turnOn/turnOff? Huh? How about:
> 
> public void enabled(boolean value)
> 

Well, it was just an example. 
 
Jose Alberto

Reply via email to