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
I get the following error
ArrayIndexOutOfBoundsException: 0 at reflect.Array.get(Native Method)at org...DynaActionForm.get(DynaActionForm.java:250)
One thing that could cause this would be specifying redirect="true" on the forward for action that prepares the display of the current JSP. In this case, a refresh would cause the JSP to be displayed without the preparatory Action being called, which is not what you want.
Thank you so much Merrill. That solved the problem. That way I also got rid of my code which saved the token. To avoid duplicate submit i.e. saveToken(request); ect. Thanks again
If you settle for what they are giving you, you deserve what you get. Fight for this tiny ad!