Below is the sample of what is happening. I've shown them step by step for how I am seeing things happening.
Here is what I get when I try the application for
1st time:
1.
http://localhost:8080/springmvc/register.htm
2. Number of locations: 4
3. Click 'Next'
I get no parameters or their values printed on the console...
4. Address: A-81, Seema Apartments
State: Illinois
5. Click 'Add Business Location'
I get the following output on console:
----------page:--------------------1----------
----------_target1:--------------------Add Business Location----------
----------serviceProvider.businessLocations[0].state.abbreviatedName:--------------------IL----------
----------serviceProvider.businessLocations[0].address:--------------------A-81, Seema Apartment----------
6. Address: ED-48, Kumaon Hostel
State: New York
7. Click 'Add Business Location'
I get the following output on console:
----------serviceProvider.businessLocations[1].address:--------------------ED-48, Kumaon Hostel----------
----------page:--------------------1----------
----------_target1:--------------------Add Business Location----------
----------serviceProvider.businessLocations[1].state.abbreviatedName:--------------------NY----------
8. Address: A-101, Mahavir Lok
State: New York
9. Click 'Add Business Location'
I get the following output on console:
----------serviceProvider.businessLocations[2].address:--------------------A-101, Mahavir Lok----------
----------page:--------------------1----------
----------_target1:--------------------Add Business Location----------
----------serviceProvider.businessLocations[2].state.abbreviatedName:--------------------CA----------
10. Click 'Next'
I get the following output on registrationConfirmationForm.jsp
locationCount: 4
Address:
State:
Address: A-81, Seema Apartment
State: IL
Address: ED-48, Kumaon Hostel
State: NY
Address: A-101, Mahavir Lok
State: CA
And the same data as shown above get persisted in the database as well in the same order.
Now when I do the same steps for the
2nd time, I get all the data shown on the console just like before but when it comes to
registrationConfirmationForm.jsp, this time it shows me the following:
locationCount: 4
Address:
State:
Address:
State:
Address:
State:
Address: A-101, Mahavir Lok
State: CA
Only 1 out of 3 Addresses and States are being deplayed this time.
I updated the
postProcessPage(..) in
RegisterServiceProviderController.java for having the data entered in the form displayed. Below is the updated
postProcessPage(..) method:
Could you help me understand what could be the reason behind it and how to get it resolved?
Thanks