cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 35846] New: - locale attribute in <formatDate> is not used in JXTemplateGenerator
Date Mon, 25 Jul 2005 09:14:15 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=35846>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=35846

           Summary: locale attribute in <formatDate> is not used in
                    JXTemplateGenerator
           Product: Cocoon 2
           Version: 2.1.7
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: core
        AssignedTo: dev@cocoon.apache.org
        ReportedBy: henric@trillian.se


Hi,

I found that the locale attribute in the <formatDate> tag is not used. I've also
seen that other people having trouble with this:
http://www.planetcocoon.com/node/2632
http://java2.5341.com/msg/108775.html

How to reproduce:
Make sure a variable named "date" is put in your jx-context.

In your jx-file:
<jx:formatDate value="${date}" locale="sv_SE"/>

Try some different locales and you will see that the date always is formatted
using the default locale in your JVM instead of the locale you specify in the
locale attribute.

How to fix it:
In the class StartFormatDate inner class (~ row 1700):
    String format(JexlContext jexl, JXPathContext jxp)
                throws Exception {
                String var = getStringValue(this.var, jexl, jxp);
                Object value = getValue(this.value, jexl, jxp);
                Object locVal = getValue(this.locale, jexl, jxp);
         ...
Change the last row above so it uses getStringValue instead:
                Object locVal = getValue(this.locale, jexl, jxp);

Best regards
Henric Müller

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

Mime
View raw message