struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonny Cavell <>
Subject Re: Character encoding problems with Struts 2 and Freemarker or Velocity
Date Wed, 02 Jan 2008 09:38:35 GMT

Thanks a lot, that has sorted it out.

I'm a bit confused as to why changing the default from utf-8 works though...

Jonny Cavell wrote:
> I am setting default_encoding=UTF-8 in, and leaving
> the struts encoding in untouched (i.e.
> struts.i18n.encoding=UTF-8). When I use a struts action to forward to a
> test page with Spanish text, without specifying the type (thus defaulting
> to jsp), it outputs fine. However, if the action forwards to the same
> page, but specifying the type as freemarker, the output is garbled. It is
> also garbled for Velocity, making me think that the problem must lie
> somewhere within Struts 2.
> Even if I subclass FreemarkerManager, override the createConfiguration
> method and explicitly call config.setDefaultEncoding("utf-8") here, and
> specify this class as the struts.freemarker.manager.classname in
>, it makes no difference - the output is garbled.
> Does anybody know why this might be the case?
> Thanks
> Jonny

View this message in context:
Sent from the Struts - User mailing list archive at

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

View raw message