Re: [tools] Using java.text.MessageFormat in templates

Nathan Bubna <[email protected]> Fri, 21 Feb 2014 11:18:03 -0800
Newsgroups gmane.comp.jakarta.velocity.user
Message-ID <CAFyaDjEuZxpAth2q36bPXDtZiU_=OYGKxL4G-2ZiowZ31o97xQ@mail.gmail.com>
I'll be honest: toward the end of my active VelocityTools use and work, i
was not using VelocityStruts and it did not get the attention it could
have. If you can make MessageResourcesTool extend ResourceTool, that sounds
reasonable to me.

ResourceTool does extend SafeConfig (via LocaleConfig) so you can use it in
any scope:
http://velocity.apache.org/tools/devel/javadoc/org/apache/velocity/tools/generic/SafeConfig.html


On Fri, Feb 21, 2014 at 10:58 AM, Christopher Schultz <
[email protected]> wrote:

> Nathan,
>
> On 2/21/14, 1:42 PM, Nathan Bubna wrote:
> > Yes, the conflict was intentional. The idea was that people using
> > VelocityStruts would default to using Struts' message support, so we
> should
> > default $text to use that. Whether that is still valid reasoning, i don't
> > know. I haven't used Struts in a very, very long time.
>
> That sounds reasonable, yet MessageTool does not extend from
> ResourceTool, so a bunch of capability is lost with that conflict. Would
> it be reasonable for MessageResourcesTool to extend ResourceTool?
>
> (I just realized that ResourceTool is "locale-ized" and therefore should
> probably not be in my application scope. Either that, or
> MessageTool.render should have another method that accepts a Locale
> argument).
>
> -chris
>
>