freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Dekany (JIRA)" <>
Subject [jira] [Resolved] (FREEMARKER-2) Option to set request locale from the given servlet request
Date Sun, 01 Nov 2015 10:34:27 GMT


Daniel Dekany resolved FREEMARKER-2.
    Resolution: Fixed

> Option to set request locale from the given servlet request
> -----------------------------------------------------------
>                 Key: FREEMARKER-2
>                 URL:
>             Project: Apache Freemarker
>          Issue Type: Improvement
>            Reporter: Woonsan Ko
>            Priority: Minor
>             Fix For: 2.3.24
> Currently templates are executed with a specific global locale all the time because FreemarkerServlet.deduceLocale()
uses config.getLocale().
> This can result in wrong date/currency formatting issue for instance (when using JSTL
> It should be able to read HttpServletRequest#getLocale().
> Normally web application frameworks sets the request locale before rendering a view.
> Daniel's remark on this in old ML:
> {quote}
> Then, I think, the default implementation of deduceLocale() should take the a new init-param
into account, let's call it "LocaleFromRequest". The default of that should be false for backward
compatibility. But if someone sets that setting to true, and the request locale isn't null,
we use that instead of the Freemarker Configuration setting. And here again, you could override
what the
> *default* is.
> Just like with "OverrideResponseContentType", the default can depend
> on the IcI on the long run.
> {quote}

This message was sent by Atlassian JIRA

View raw message