velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Bubna <nbu...@gmail.com>
Subject Re: Changing default locale for VelocityViewServlet and their tools
Date Mon, 30 Aug 2010 19:20:51 GMT
Subclass VelocityViewServlet and implement a protected void
fillContext(Context ctx, HttpServletRequest request) method.   Cast
the Context to a ToolContext and then use do putToolProperty("locale",
yourLocale).   Or do something like that.  You just need to get ahold
of the ToolContext and set the locale tool property before the tool(s)
in question get initialized and after the request locale has been set
(so yours doesn't get overridden).

On Fri, Aug 20, 2010 at 5:26 AM,  <sgfan@gmx.net> wrote:
> Hi,
>
> I am struggling with some stupid configs of VelocityViewServlet. The locale for the tools
in the toolbox are taken from the http request. Which is fine als long as you don't use any
other framework. Well, I do use JSTL and it handles it locale differently. I want to auto-inject
this locale into the tools.
> I have figured out that in ViewToolContext#107 the locale is auto-set. How can I reset
this locale in my VelocityViewServlet?
>
> Thanks,
>
> Mike
> --
> GMX DSL SOMMER-SPECIAL: Surf & Phone Flat 16.000 für nur 19,99 ¿/mtl.!*
> http://portal.gmx.net/de/go/dsl
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


Mime
View raw message