base on your new requirement, I believe there are several way to solve this problem. but I think a good solution should hide any logic problems and always make clents not realize their wrong operation, but always get correct results.
I dont like make any unexpected things happened to clients, for example, if client click back button or something else, then they are kicked out of "current status", and forced to be in a unexpected "status".
in the second page, assumed that you get information(String) by these method.
//initiate, get value and count how many value you got
Vector forSave=new Vector(), savedInfo=new Vector();
//save all coming information in vector forSave every time
for(int i=1; i<=count; i++)
//if this is first time, no old value to compare, but need to save these value for comparation next time
if(session.getAttribute("savedInfo")==null && request.getParameter("submit")!=null)
save ss1, ss2, ss3....;
//if this is not first time, you need get old saved value to compare with current value. only those value that never be saved before can be saved this time
if(session.getAttribute("savedInfo")!=null && request.getParameter("submit")!=null)
for(int i=0; i<forSave.size(); i++)
for(int j=0; j<savedInfo.size(); j++)
//right now, every string in vector forSave never saved before
retrive information form vector forSave and save them to database or what ever;
//save vector savedInfo in session for comparation next time
this code is just showing an algorithm to compare coming infomation with old saved infomation. only those information never saved before can be saved only this time.
hope it is helpful for u