aspose file tools*
The moose likes Servlets and the fly likes invisible intermediary servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "invisible intermediary servlet" Watch "invisible intermediary servlet" New topic
Author

invisible intermediary servlet

sean divine
Greenhorn

Joined: Oct 27, 2005
Posts: 14
Making my first attempt at a web shopping cart. I've got the cart working and now need to pass the cart values to paypal. The order info and cart items are passed to paypal using a form with method "post".

The problem is that I want to capture these request values between the customer's cart page and paypal. I could do this by sending the customer to an intermediary page and having them click "next" to take them to paypal. But I don't want the customer to have to see one more unecessary page and make one more unecessary click.

What I'd like would be to have the form send the request values to a servlet that would capture and act upon the values before automatically redirecting everything to paypal. The customer should be unaware that this intermediary servlet exists.

This shouldn't be too difficult but I can't think of how to do it with my limited knowledge of servlets.

Any suggestions would be greatly appreciated.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42648
    
  65
You don't have to have the user click on a button, as long as they have JavaScript enabled. Just return a page saying "thank you, we're now taking you to paypal, bla bla", and in the onLoad handler you submit a hidden form on the page to PayPal. If JavaScript is off, the user would still click the button, though.


Ping & DNS - my free Android networking tools app
sean divine
Greenhorn

Joined: Oct 27, 2005
Posts: 14
Thanks for the tip. I'll give it a try.
 
Don't get me started about those stupid light bulbs.
 
subject: invisible intermediary servlet