velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bryce Nesbitt <>
Subject Re: How to output a tab from a velocity template?
Date Thu, 15 Dec 2005 02:08:39 GMT
Nathan Bubna wrote:
>    if actual tabs aren't icky in the output, then i don't see why they're
> icky in the input.  Velocity doesn't do anything special for or with
> tab characters.
Because the source code is in a multiplatform multideveloper environment
that does not preserve (or allow,
or tolerate) tabs.
The export is in user-land.

>   if you want a tab character in the output, the
> simplest thing is to put it in the input.  but if you really don't
> like that, you can always put a string containing just a tab in the
> context:
> context.put("tab", "\t");
> and then use
> ${tab} in your template.
Cool, could you give me one more hint on where to find the right
context? I did this, without joy:

...extends ActionSupport...

 public String execute() throws Exception {
        return "tabexport";

<!-- something.vm -->
$res.setHeader("content-type", "text/plain")
$res.setHeader("Content-Disposition", "attachment;

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

View raw message