File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes show a website's response on my web page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "show a website Watch "show a website New topic

show a website's response on my web page

Reet Goel

Joined: May 02, 2007
Posts: 14

I was asked a question in an interview and I couldn't answer it. Need to know it's answer.

I may not remember the question exactly but it was somewhat as given below:

Suppose, you have a shopping site. When a user buys a product and pays for it you open the user's bank site from your own shopping site. Now, once the payment has been made the response of the bank's site should get displayed on your site. How would you accomplish this?

Can someone please answer this question?

[ August 08, 2007: Message edited by: Bear Bibeault ]
Akhilesh Trivedi
Ranch Hand

Joined: Jun 22, 2005
Posts: 1599
If I am not understanding you wrong, you want to make online shopping feasible and everything happening real-time, payments being made online and changes being reflected in the bank account then and there.

I believe your shopping site and bank's site should have a tie up. You can not share your shopping cart knowledge with the bank. Bank can not give you the source-code or knowledge of how they are maintaining their transactions, they can only give you some information like,
give me account number, give me amount, tell me what transaction to do, i will give you back the response.

I guess your site should be using services from of the bank. Will the term web-services come into play? I dont know because I am learning web-services, but i doubt if that is the case.

Keep Smiling Always — My life is smoother when running silent. -paul
[FAQs] [Certification Guides] [The Linux Documentation Project]
Akhilesh Trivedi
Ranch Hand

Joined: Jun 22, 2005
Posts: 1599
And since you mentioned it was in interview, so if the question being not too technical then there are third parties like Paypal. You can try googling 'paypal'.
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
Is the question about displaying the other site in a frame or iframe?
Sundaram Karthick

Joined: Jun 26, 2007
Posts: 24
I am not closely following yur question, but if the question was after submitting the items in shopping cart and forwarding the purchase details to the payment site and once the payment is made, display the required details in your site, there are 2 things here
1. the payment success state
2. the payment gateway site forwarding back to the origin site based on payment result.
If the payment is made successfully, the payment site will itself confirm the same and will forward the user back to the origin site. Based on the success state a specific page/action can be invoked and the required details can be displayed.
Usually all this happens in a https , so the required information and payment result can be exchanged as hidden formfields or a complete form submit. Also as mentioned above webservices can also be used here.
Hope this helps

SCJP 1.5, SCWCD 1.4, SCBCD 5
I agree. Here's the link:
subject: show a website's response on my web page
It's not a secret anymore!