tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 43285] - Missing EL Coercion causes argument type mismatch
Date Tue, 19 Feb 2008 23:48:56 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43285>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43285





------- Additional Comments From Subba.Ayyagari@fnf.com  2008-02-19 15:48 -------
To add to my comment above: 

Here is my bean:
MyBean { 
   private Long number; 
   ...//getter 
   .. //setter 
   .. // other methods
}

Here is my JSP (JSF Page rather):
<h:selectOneMenu
    value="#{myBean.number}"
    required="false"
    converterMessage="Number value is invalid">
    <f:selectItems value="#{myBean.allNumbers}"/>
</h:selectOneMenu>

myBean.allNumbers is implemented as follows:

public List<SelectItem> getAllNumbers() {
   List<SelectItem> list = new ArrayList<SelectItem>(0);
   list.add(new SelectItem("", "--SELECT--"));   // NOTE: this causes the issue
   list.add(new SelectItem("1", "ONE"));
   list.add(new SelectItem("2", "TWO"));
   list.add(new SelectItem("1", "THREE"));
   return list;
}

Now, when i don't select a value (ie., leave the drop down on --SELECT--) for
the Number and submit the form, Tomcat 6.0.16 would set the myBean.number to 0.
Until Tomcat 6.0.14, the value is NULL.

Why is this important? It ends up putting 0's in the database instead of NULL's.

Thanks

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Mime
View raw message