You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Derrick Koes <De...@skillsoft.com> on 2006/09/20 20:18:37 UTC

Struts/beanutils problem for Indexed Form Property

Struts 1.2.9
Tomcat 5.0.28
Java 1.4.2
 
Basically, if the session times out or tomcat is restarted (I think
re-start of the web app would probably do it) and sessions aren't being
serialized (This happens when they are too I think) AND the app is left
on a page with a form containing an indexed property, you get a stack
trace submitting the form after tomcat is started (in the re-start
case--session timeout--you just get the problem)--not a real good user
experience.  The issue is the form bean is nulled, er rather a new form
bean is created because you have a new session presumably (the form bean
is session scoped), but the properties map contains a reference to an
indexed property like "schedule[0]".  So, what happens is that using the
property name from the map (schedule[0]), this property is accessed in
the form bean to get the value, but the form bean has an empty
ArrayList, so there is nothing but null at index 0.  You get an
IndexOutOfBoundsException.
 
This problem only occurs on forms with indexed properties.  I get my
session timeout page when on any other form.
 
Any help is appreciated.