You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by bu...@apache.org on 2005/07/25 11:06:59 UTC

DO NOT REPLY [Bug 35845] New: - locale attribute in is not used in JXTemplateGenerator

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=35845>.
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=35845

           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.