Hello

I read through several discussions about this problem but havent come to a
conclusion on how to resolve it.

A very simple explanation of my problem

I have two JSP pages. On page 1 - several account numbers are displayed.
When a user selects a particular account, in my action class, I'm getting
all the addresses associated with the account. All these address information
is stored in beans (AddressBeans) and the beans are stored in an arraylist
and the arraylist is part of my actionForm.

Then the control is forwarded to my second jsp page, where I get this
arraylist, iterate through it, get the individual address beans and display
the information. On this page, for each address bean, I'm having some
textboxes to capture information for that particular address. So I'm using
indexed property. I submit the form and everything works fine.

The problem comes when I open a new window from the first one. 

An example scenario -

1) On the first JSP page, I open an account which has say 2 Address Beans -
so the second JSP page is displayed with 2 Address Beans. The arrayList
property of the actionForm has 2 elements.
2) From this page - I open a link in a new window which takes me back to
Page 1. Here I select another account which has say 1 Address Bean. The
second page is opened and 1 address bean info is displayed. Now the
arraylist property of ActionForm has been overridden and has 1 element.
3) Now I come back to my first window, where I was displaying 2
AddressBeans, fill in the information for the textboxes for each addressbean
and click on submit and then I get this error

javax.servlet.ServletException: BeanUtils.populate
root cause 
java.lang.IndexOutOfBoundsException: Index: 1, Size: 1

Which is understandable. When ActionForm tries to fill the indexed
properties for the 2 Addressbeans in the list, it finds only one element in
the list.

First of all, is my understanding of this problem correct. Secondly what is
the best way for me to handle this problem. I've read people talk about
overriding RequestProcessor class and create a new action form instance
everytime.

Any suggestions will be appreciated.
Thanks







------------------------------------------------------------------------------
Notice:  This e-mail message, together with any attachments, contains 
information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New 
Jersey, USA 08889), and/or its affiliates (which may be known outside the 
United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as 
Banyu) that may be confidential, proprietary copyrighted and/or legally 
privileged. It is intended solely for the use of the individual or entity named 
on this message.  If you are not the intended recipient, and have received this 
message in error, please notify us immediately by reply e-mail and then delete 
it from your system.
------------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to