myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mario Ivankovits <>
Subject Problems with JSPStateManagerImpl and serialized views
Date Fri, 28 Apr 2006 21:06:01 GMT

In JSPStateManagerImpl NPEs might happen (I think in conjunction with
DummyForm) if SerializedViewCollection.add will be called more than once
per page.
Which is a documented behaviour in DummyFormUtils.

The reason is, that the _keys list will contain the same key more than
once than, now, if it comes that views have to be removed (more views in
session than configured) the same key will be removed more than once and
the old view put into the oldSerializedViewsMap.
In the second iteration a NPE will be thrown as _serializedViews will
return "null" then (the view already were removed).

To avoid this exception I added
while (_keys.remove(key));
to ensure the key will be unique in the _keys list.

I dont have the feeling that this is the best possible solution to this
Any objections - better solutions?


View raw message