• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Refresh problem with JSPs

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Ranch Hand
Posts: 645
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic