aspose file tools*
The moose likes Servlets and the fly likes Help needed in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Help needed in JSP" Watch "Help needed in JSP" New topic
Author

Help needed in JSP

asheesh talwar
Ranch Hand

Joined: Dec 10, 2000
Posts: 31
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
Julia Reynolds
Ranch Hand

Joined: May 31, 2001
Posts: 123
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

Joined: Dec 10, 2000
Posts: 31
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

Joined: May 31, 2001
Posts: 123
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help needed in JSP