struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dariusz Wojtas (JIRA)" <>
Subject [jira] Created: (WW-1581) Problems with handling of Double in the request parameters
Date Fri, 29 Dec 2006 13:51:57 GMT
Problems with handling of Double in the request parameters

                 Key: WW-1581
             Project: Struts 2
          Issue Type: Bug
          Components: Actions
    Affects Versions: 2.0.2
         Environment: windows XP [Polish locale], tomcat 5.5.17, Java 6
            Reporter: Dariusz Wojtas
            Priority: Critical

I have a property in my form
  private Double someValue;
with get/set methods

Then I display it on my form
   <s:textfield name="someValue" cssStyle="width: 100px;"/>

fill some value:  1234
and submit the form [Firefox]

the URL looks like this:
and is automatically generated by the browser.
On the console I get stacktrace and no hint what is going on:

	at com.opensymphony.xwork2.DefaultActionInvocation.createResult(
	at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(
	at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(
	at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(
	at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(
	at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(
	at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(
	at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(
	at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(
	at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(

(A bit related to WW-1577)

If I change URL to one of:
   /my.action?someValue=1234,0     [colon instead of dot]
then it works.

IE 6 does not add '.0' if the number is an integer.
But if I add it by hand:
   1234.5   [english user using my polish server]
then if fails.

Most likely the Double handler initializes itself with the machine specific locale (in Poland
colon is the separator for doubles) and it fails.

In fact this is a highly critical issue if this cannot accept simple numeric value on non
english server machine.

I am not sure if this is not in conflict with some other conditions, but possibly the Double
converter should use one specific locale and try to convert input data first to be compatible.
For example use locale ENGLISH, and try to format the input strings by replacing comma with

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


View raw message