Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002634 [Resin] minor always 04-28-08 15:52 06-12-08 14:39
Reporter nam View Status public  
Assigned To ferg
Priority normal Resolution fixed  
Status closed   Product Version 3.1.5
Summary 0002634: overloaded setters in custom JSP tag
Description (rep by J. Reynaert)

I have a custom tag:
 
Class file snippet:
public void setValue(Object obj){
  if(obj instanceof Float)
   this.value = ((Float)obj).toString();
        else if (obj instanceof Integer)
            this.value = ((Integer)obj).toString();
        else if(obj instanceof String)
            this.value = (String)obj;
    }
 public void setValue(String value) {
        this.value = value;
    }
 public void setValue(int value) {
        this.value = String.valueOf(value);
    }
 public void setValue(float value) {
        this.value = String.valueOf(value);
    }
 
test.jsp
<%@taglib uri="/tld/input.tld" prefix="input" %><%
float value = 1.0F;%>
Float <input:label id="test" value="<%=value%>"/>

Integer <input:label id="test" value="<%=(Integer)4%>"/>

String expliciet <input:label id="test" value="<%=(String)"foo"%>"/>

String default <input:label id="test" value="foo"/>

 
error occurs on the last line (value="foo")
Caused by: java.lang.NumberFormatException: For input string: "foo"
 at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1224)
 at java.lang.Float.valueOf(Float.java:388)
 at com.caucho.jsp.java.JspNode.generateParameterValue(JspNode.java:1259)
 ... 28 more

Why is it using the float method?? Is there some setting in resin.conf to define this?
P.S. it worked for about 2 weeks and today, it suddenly changed. I only recompiled a jsp that is using the custom tags
On my development server, a windows2003 machine, it is OK, but on RedHat3.0 it's not OK
 
Very bad thing. eg <input:text name.... value="1"> is rendered in <input type="text" ..... value="1.0">
Additional Information
Attached Files

- Relationships

- Notes
(0003186)
ferg
06-12-08 14:39

jsp/184z
 

- Issue History
Date Modified Username Field Change
04-28-08 15:52 nam New Issue
06-12-08 14:39 ferg Note Added: 0003186
06-12-08 14:39 ferg Assigned To  => ferg
06-12-08 14:39 ferg Status new => closed
06-12-08 14:39 ferg Resolution open => fixed
06-12-08 14:39 ferg Fixed in Version  => 3.2.0


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
29 total queries executed.
26 unique queries executed.
Powered by Mantis Bugtracker