OK, it looks like adding a null value in the options datasource does
cause a NPE like this one:
at org.apache.beehive.netui.tags.html.Select.doEndTag(Select.java:917)
at
org.apache.jsp.bugs.b39552.index_jsp._jspx_meth_netui_select_0(index_jsp.java:210)
...
I'm going to change the test to add null values to all the options
datasources, and I'll change the code to avoid an NPE, unless anyone out
there can tell me that I'm misunderstanding the issue. :)
Rich
Richard Feit wrote:
OK, thanks for the info, Krista. I'll modify the test, but will keep
it in the spirit of the original purpose.
Rich
Krista Baker wrote:
Rich,
This Bug bvt is from the old days of netui. As far as I can tell, the
following is the reason it was produced:
There was an NPE that occurred when a select box binds to a Map in the
JPF for the optionsDataSource and to a String[] for the dataSource., The
NPE occurred because the form would create the dataSource array which
had a single, null element and the select tag could not handle it.
(lazy instatiation in the form's property getter). The change was that
if the options array contained null values, then they were not supposed
to be added as options.
Thanks,
Krista
-----Original Message-----
From: Rich Feit [mailto:[EMAIL PROTECTED] Sent: Friday, June 17,
2005 2:20 PM
To: Beehive Developers
Subject: Re: sporadic netui bvt failure related to CheckBoxGroup
Hey -- does anyone know what exactly the B39552 test is supposed to
verify? The description for the test (in
netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml) is
"Verify that options data source may be contain null values", but
none of the options datasources in the page flow actually contain
null values. On top of that, I think the sporadic failure may be due
to the fact that all three inputs (select, radio group, checkbox
group) are binding to the same form property. In addition to that,
the radio button group is binding to an array when it should be
binding to a single value. I can re-record the test with fixes, but
I should understand the original problem first. :)
Thanks,
Rich
Rich Feit wrote:
OK, thanks for the info -- I'll try that. It's possible that the test
was just recorded with some leftover state in the tag instance.
Rich
Eddie ONeil wrote:
Yeah, I think your assessment is correct -- those should be reset in
localRelease which contains all of the un-initialization code for a
classic tag handler.
For the _state and _hiddenState variables, try calling "clear()" and
for the _writer, just null it out.
Not sure whether that will solve this specific problem, but that
should be the behavior of NetUI JSP tags.
Eddie
On 6/16/05, Rich Feit <[EMAIL PROTECTED]> wrote:
Hi all,
I'm seeing a sporadic failure of the 'B39552' test when running 'ant
bvt' under netui. Here is the diff between recorded/playback
results:
R: <input type="hidden"
name="wlw-checkbox_group_key:{actionForm.selectedItems}OldValue"
value="true"><input type="checkbox"
name="wlw-checkbox_group_key:{actionForm.selectedItems}" value="1"
checked><span>Option 1</span><br>
* P:* <input type="hidden"
name="wlw-checkbox_group_key:{actionForm.selectedItems}OldValue"
value="true"><input type="checkbox"
name="wlw-checkbox_group_key:{actionForm.selectedItems}"
value="1"><span>Option 1</span><br>
In looking at
netui/src/tags-html/org/apache/beehive/netui/tags/html/CheckBoxGroup.jav
a,
I'm wondering if the following member variables should be nulled out
during localRelease():
_state (nulled out or call clear())
_hiddenState (nulled out or call clear())
_writer
Seems like they should, but I know this is tricky code. Anyone have
insight into this?
Thanks,
Rich