[
http://www.stripesframework.org/jira/browse/STS-697?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ben Gunter resolved STS-697.
----------------------------
Resolution: Not a Bug
This is working exactly as it is intended. The reason the numeric formatting
isn't being done according to the locale is because you aren't formatting a
number. You're formatting a string, specifically the string "-1". When the
format tag requests a Formatter from the FormatterFactory, it requests a
formatter based on the type of the value to be formatted. If you pass in a
String, it will get a StringFormatter. If you pass in a number, it will get a
NumberFormatter. I recommend you replace the string "-1" with the expression
"${-1}", which will pass an actual number to the format tag.
Some confusion might arise from the formatType="number" attribute you're giving
to the format tag. That attribute is not a directive to the format tag itself.
It is instead passed along to the formatter. Different formatters understand
different format types. In the case of NumberFormatter, you might use, e.g.,
"decimal" or "percentage".
> Formatting numeric values in param tag not working correctly with RTL
> languages
> -------------------------------------------------------------------------------
>
> Key: STS-697
> URL: http://www.stripesframework.org/jira/browse/STS-697
> Project: Stripes
> Issue Type: Bug
> Components: Formatting, Tag Library
> Affects Versions: Release 1.5.1
> Environment: Solaris 10, Java 1.6.0_14
> Reporter: Martin Walsh
> Priority: Minor
> Fix For: Release 1.5.2, Release 1.6
>
>
> Using a RTL locale, when attempting to format a negative number as a URL
> parameter it is not formatted correctly.
> <ss:url value="<%=ACCOUNT_KEYS_ACTION%>" event="view" var="popup_url">
> <ss:param name="keyId">
> <ss:format value="-1" formatType="number"/>
> </ss:param>
> </ss:url>
> Produces:
> keys.action?view=&keyId=-1
> when it should produce:
> keys.action?view=&keyId=1-
> Which is what the integer type converter expects. This only seems to occur
> when providing literal values. If i get the value from the action bean:
>
> <ss:url value="<%=ACCOUNT_KEYS_ACTION%>" event="view" var="popup_url">
> <ss:param name="keyId">
> <ss:format value="${actionBean.keyId}" formatType="number"/>
> </ss:param>
> </ss:url>
> Then the correct URL is displayed.
> keys.action?view=&keyId=1-
> I checked the format tag on its own:
> <ss:format value="-1" formatType="number"/>
> which seems to display the correct value of 1-
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://www.stripesframework.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development