Hi:
I am working on a project which requires B2B integration of two site.
This integration is done by third party. We have to handle the "Add to
Shopping Bag" module.
1. User will come to site1 and then he requests for a product which
is avaialble in site2. Since these two sites are having B2B relation,
user can navigate to site2. But the top and botton navigation bar will
be from site1, this will be a virtual site of Site1 and Site2.
2. On pressing "Add to bag" on virtual site, that particular item
should be added into Site1 "Shopping cart". That means its calling our
program in site1 which will add that product into out cart and after
that it will redirect to the site2 and displays the same page. But
additionally we have to display a popup window showing that "This item
has been added to Site1 bag", or "This item is not available".
Here Site1: Primary Vendor
Site2: Secondary Vendor
Here Site1 and Site2 are two different domains.
Following is the Sample Code which simulate the above flow:
=====================================================================================
Program1: This program is on Site2 which displays a simple page, on
pressing submit button, it transfers control to another servlet which is
on Site1.
out.println("<HTML><BODY>");
out.println("<FORM name=\"urlRedForm\"
action=\"http://site1/servlet/UrlRed2\" method=\"get\">");
out.println("<CENTER><H3>Virtual Site</H3></CENTER>");
out.println("<INPUT TYPE=\"HIDDEN\" NAME=\"redUrl\"
VALUE=\"/http://site2/servlet/RedUrl1\">");
out.println("<INPUT TYPE=\"SUBMIT\" VALUE=\"Add to Bag\">");
out.println("</FORM>");
out.println("</HTML>");
out.println("</BODY>");
=====================================================================================
Program2: This program is on Site1 which add a product into shopping
cart and then transfer back to Program1 and displays a popup window
showing that "Item is added into cart".
out.println("<HTML>");
out.println("<SCRIPT LANGUAGE=\"JAVASCRIPT\">");
out.println("var win = window.open(\"\", \"UrlRed\",
\"width=300,height=200\");");
out.println("win.document.open(\"text/html\", \"replace\");");
out.println("win.document.write(\"<HTML><HEAD><TITLE>Popup
Window</TITLE></HEAD><BODY><H3>This item has been added to Site1 Cart "
+ strCtr + " </BODY></HTML>\");");
out.println("win.document.close();");
out.println("</script>");
out.println("</HTML>");
res.sendRedirect("http://site2/servlet/UrlRed1");
=====================================================================================
If I execute the above program, its sucessfully passing control back to
site2 but unable to display the popup window. I will appreciate if
anybody can help me on this.
Thanks in advance.
Sushil
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html