• Post Reply Bookmark Topic Watch Topic
  • New Topic

Refresh problem with JSPs

 
Julia Collins
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
On my JSP page I have a table that displays previous purchases (that are stored in an array list). Next to each purchase there is a "Remove" link. This link forwards to an initialising action class with the parameter ?Remove=<index>.
The item is then removed from the array list and the JSP is redisplayed.
This is all very well - the problem come in if you have removed an item from the list, come back to the JSP page and hit "Refresh". If you hit refresh another item is removed (from the same index as previously specified). How do I stop this happening??
Thanks,
Julia
 
Vijay Gopalakrishnan
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't use the index number to remove, use item/product no, to remove the object.
 
Julia Collins
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That might work - but because it is not a conventional shopping cart (it contains Network Links) there is no unique identifier, aside from a combination of the type of link and the IP Address. If I pass both of these and the index that should work.
I will give this a go - but if anyone knows of another way to do this please spill the beans.
Thank you!
 
Praful Thakare
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Julia,
Is it possible to replace productid by some value say -1 when some product is removed from array list.
eg if product with id 55 in array at index 10 is removed then just replace 55 with -1 at index 10
so when refresh is hit again -1 will be replaced by -1
cheers
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!