Why do you use such url http://localhost/UrlRed.html
change localhost to site1    ie http:/site1/UrlRed.html



>        out.println("<SCRIPT LANGUAGE=\"JAVASCRIPT\">");
>
out.println("window.open('http://localhost/UrlRed.html','UrlRed','left=40,to
>
p=40,width=640,height=450,toolbar=no,status=no,scrollbars=yes,resizable=yes'
> )");



-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Sushil Singh
Sent: Friday, September 08, 2000 10:56 PM
To: [EMAIL PROTECTED]
Subject: Re: Invoking Popup Window in Virtual Site


Thanks for your reply.

If you see program2 which is using Javascript to display the popup page and
after
that url redirection is there, but the problem is that its not displaying
the popup
window and sucessfully redirect to site2.



Artem Babenko wrote:

> I think you should use JavaScript.
> To show popup you need a additional request from the client.
> There are two ways to receive this additional request.
> First user should click every time somewhere when you want to get a popup.
> (does not suit)
> Or JavaScript will do it automatically.
>
> -----Original Message-----
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of Sushil Singh
> Sent: Friday, September 08, 2000 9:10 PM
> To: [EMAIL PROTECTED]
> Subject: Invoking Popup Window in Virtual Site
>
> 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
>
> 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 jsp on Site.
>
> <HTML>
> <BODY>
> <FORM name="urlRedForm"  method="post" action="/UrlRed2.jsp">
> <CENTER><H3>Testing URL Redirection</H3></CENTER>
> <BR><BR><BR><BR><BR>
>    Press the submit button to perform url redirection
> <BR><BR><BR><BR><BR>
> <INPUT TYPE="HIDDEN" NAME="redUrl" VALUE="/RedUrl1.jsp">
> <INPUT TYPE="SUBMIT">
> </FORM>
> </HTML>
> </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".
> <%@ import="java.io.*,javax.servlet.*,javax.servlet.http.*" %>
> <HTML>
> <BODY>
> <%
>        // Declaring local varialbles
>        String redUrl = "";
>        // Set content type and other response header fields first
>        response.setContentType("text/HTML");
>        // Redirecting URL
>        redUrl = (String) request.getParameter("redUrl");
>        // Popup Window
>        out.println("<HTML>");
>        out.println("<SCRIPT LANGUAGE=\"JAVASCRIPT\">");
>
out.println("window.open('http://localhost/UrlRed.html','UrlRed','left=40,to
>
p=40,width=640,height=450,toolbar=no,status=no,scrollbars=yes,resizable=yes'
> )");
>
>        out.println("</script>");
>        out.println("</HTML>");
>        // Redirecting
>        response.sendRedirect("/UrlRed1.jsp?bagFlag=Y");
> %>
> </HTML>
> </BODY>
>
============================================================================
> =========
>
> Program3: This is an HTML which displays contains the text for popup
> window.
> <html>
> <body>
> <h3>Item has been added to Site1 bag</h3>
> </body>
> </html>
>
> 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: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to