You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2003/12/15 16:38:13 UTC

DO NOT REPLY [Bug 25536] New: - formatKey works incorrectly in

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25536>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25536

formatKey works incorrectly in <nested:write>

           Summary: formatKey works incorrectly in <nested:write>
           Product: Struts
           Version: 1.1 Final
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Custom Tags
        AssignedTo: struts-dev@jakarta.apache.org
        ReportedBy: vspa@mail.ru


Hi, guys.

In my form I have a property of type BigDecimal. I want it formatted in on my page 
accordingly to the pattern: &euro';' #,##0.00 (I want to get something like � 
123.123,45).

If I use <nested:write property="price" formatKey="format.euro" 
filter="false"/>
where I have in the resource file: format.euro=&euro';' #,##0.00 it gives 
me an  exception "Wrong format: '&euro';' #,##0.00'". More over, only the following pattern 
works: #, if I specify #,### - throws that exception.

>From the other hand, if I move this pattern 
directly into format attribute:
<nested:write property="price" format="&euro';' 
#,##0.00" filter="false"/> it works perfectly (so I use not formatKey, but format).

I 
determined, that this happens because org.apache.struts.taglib.bean.WriteTag uses 
DecimalFormat.applyLocalizedPattern() method for patterns retrieved from resource bundle 
and just DecimalFormat.applyPattern() for directly specified patterns. 

I dunno, whether 
it's normal behaviour or not (suppose not), but please have a look at it.

PS. I use sun's jdk 
1.3_2.

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org