You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by naslund26 <jo...@sympatico.ca> on 2006/12/07 03:23:43 UTC

ArrayI ndex OutOfBoundsException when page refresh

I have an action which uses the following form-bean below. All works fine
when the page is first displayed. In addition to user submit. For example
AccessRequest[] can initially contain a list of requests lets say 5. The
user can then modify request by updating info. For example he may update 2
of the 5. Then hit submit. Once requests are modified they are removed from
the list. The page is refreshed and there will only be 3 requests. All works
fine. However if user hits refresh on the browser I get the error below. Its
very strange if I simply update one request it works fine. If user updates
more than one it throws error when refresh is hit. I have placed break
points throughout and it gets to the reset() method in MyDynaActionForm
which obtains the correct array size. It then exits reset() and error is
thrown. It never reaches the action. Thank you all for your time.

I have the following form in struts-config

    code:

    <form-bean name="dynamicArrayForm" type="...MyDynaActionForm">
         <form-property name="entityList" type="Entity[]"/>
         <form-property name="access" type="AccessRequest[]"/>
    </form-bean>

I have the following. /setupForm is initially called to display the data.
setuppage.jsp will call /processForm.

    code:

    <action path="/setupForm" type="SetupFormAction" name="dynamicArrayForm"
scope="session" validate="false">
                <forward name="success" path="/setuppage.jsp"/>
    </action>
            
    <action path="/processForm" type="ProcessFormAction"
name="dynamicArrayForm" scope="session" validate="false">
                <forward name="success" path="/setupForm.do"/>
    </action>

I get the following error

ArrayIndexOutOfBoundsException: 0 at reflect.Array.get(Native Method) at
org...DynaActionForm.get(DynaActionForm.java:250)
-- 
View this message in context: http://www.nabble.com/ArrayI-ndex-OutOfBoundsException-when-page-refresh-tf2772149.html#a7732461
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org