struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dave J Dandeneau" <>
Subject BUG: Null strings getting converted to 'null' was Websphere and 'null' strings
Date Fri, 15 Feb 2002 16:06:06 GMT
I know that a few other people have been confused by this bug, so I hope this clears things
up. The bug is just a small quirk in the Option Tag code. It seems that StringBuffer works
differently on the different JDKs. Here is an example:

StringBuffer sb = new StringBuffer();
String x = null;


On our Websphere instance which seems to be using jdk 1.3.0 we get this output:

On a tomcat instance using jdk1.3.1_01 we get this output:

After many hours of debugging we found a location in the OptionTag code (org.apache.struts.taglib.OptionTag
and org.apache.struts.taglib.html.OptionTag) that was having this problem. It occurs when
the value field is filled out. It looks something like this:

results.append("<option value=\"");

We added a fix that looks like this:

results.append("<option value=\"");
if (value != null) {

I am sure that this is also a bug in other tag code regarding this issue. I am going to add
this to bugzilla today. 

Dave Dandeneau

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message