• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Help needed in JSP

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have an application in which I have a shopping cart page (jsp)
on clicking the submit order button on the cart page I go to order confirmation page(jsp).I am passing all the values present on the cart page as hidden values to the confirmation page
There is one remove button on the cart page just like yahoo
which has checkboxs against the records & users can select the checkbox to remove any item.Once he removes all the items a mesage in red font comes that n items have deleted & there are no items in the cart.
Now my problem is that if user presses the back button of the browser after he has deleted the items then he comes to the cart page where he has checked the checkboxes & if then he presses the submit order button then he is shown the confirmation page with the all the items(which in reality are not there)
Basically I want how to prevent the user to visit the previous page.
Any pointers in this regards will be of great help
Regards
Asheesh
 
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is problematic to disable the back button. One thing you can do is try to put this in your html in the head tag:
<HEAD><META HTTP-EQUIV="Pragma" CONTENT="no-cache">
</head>
This will remove the cache of the browser and (I think) cause the previous page to be refreshed and blank when you hit the back button.
Julia
 
asheesh talwar
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Julia
I tried with that thing but now also I am able to visit my previous page.
Is there any other way out ?
Ashish
 
Julia Reynolds
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, I am a little confused as to the exact problem I guess.
You might try putting the items in the JSP session rather than depending on html form variables the whole time, then it would be easier to clear out the cart from the session. Here is a good link for writing a JSP shopping cart.
http://www.devx.com/upload/free/features/javapro/2000/06jun00/gb0006/gb0006.asp
Julia
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic