Re: fmt:formatNumber not formatting on first page load
Stephen Souness <[email protected]>
| Newsgroups | gmane.comp.jakarta.taglibs.user |
|---|---|
| Message-ID | <[email protected]> |
Looks like I posted too soon.
Re-starting Tomcat on the Linux server, and then reloading the page
containing the JSTL produces our old friend the conspicuously
non-formatted number.
Here's a snippet from my server.xml, in case anyone can find a glaring
issue to explain what I have been observing:
<Host name="www.mystuffgoeshere.com" debug="9"
appBase="/usr/local/webapps"
unpackWARs="true" autoDeploy="true" xmlValidation="false"
xmlNamespaceAware="false" reloadable="true"
tcpListenAddress="192.168.1.77">
<Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
driverName="net.sourceforge.jtds.jdbc.Driver"
connectionName="NotTelling"
connectionPassword="ASecret"
connectionURL="jdbc:jtds:sqlserver://127.0.0.1/NotTelling
userTable="LOGIN" userNameCol="USERNAME"
userCredCol="PASSWORD"
userRoleTable="LOGIN" roleNameCol="ROLE"/>
</Host>
Other aspects of my application:
- Using Tomcat's built-in security (hence JDBC Realm defined above)
- Using Struts 1.2.8
- Using Tiles
--
Stephen
Stephen Souness wrote:
> Windows XP Professional is the OS that this app has encountered this
> issue on.
>
> We'll be deploying it to a Linux box when it goes live, and my tests
> today indicate that everything goes fine first time under Linux (for
> that particular aspect at least - let's not tempt Murphy to invoke the
> law).
>
>
> --
> Stephen
>
>
>
> Rahul Akolkar wrote:
>
>> On 2/2/06, Stephen Souness <[email protected]> wrote:
>>
>>> More info:
>>>
>>> - the value is a string along the lines of :
>>> 165000.0
>>>
>>> So what I would expect to happen is:
>>> - the decimal point and fractional 0 to be truncated
>>> - a '$' symbol to be pre-pended
>>> - a ',' between the '5' and the first '0' indicating thousands
>>>
>>> Each time Tomcat is restarted, the first load of the page shows:
>>>
>>> 165000.0
>>>
>>> subsequent page loads give the correct:
>>>
>>> $165,000
>>>
>>
>> <snip/>
>>
>> On Tomcat 5.0.28, JDK 1.4.2, JSTL 1.1, this JSP:
>>
>> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
>> <fmt:formatNumber value="165000.0" type="currency"
>> currencySymbol="$" maxFractionDigits="0" />
>>
>> give me this output:
>>
>> $165,000
>>
>> The first time, and every time beyond that. There's something else
>> going on in your setup. I can't say based on the information we have.
>>
>> -Rahul
>>
>>
>>
>>> --
>>> Stephen
>>>
>>
>> <snap/>