Hi Friend,
Here it is my code (this is the
servlet which is invoking the HTML which integrate the Applet Code) :
public void doGet(HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse) throws ServletException, IOException
{
PrintWriter printwriter=httpservletresponse.getWriter();
httpservletresponse.setContentType("text/html");
pp=httpservletrequest.getParameter("T1");
b=true;
if (b)
{
printwriter.println("<html>");
printwriter.println("<script language='javascript'>");
printwriter.println("function ");
printwriter.println("doit(htmlfile) { popUpWin=window.open(unescape(htmlfile),'smallWin','height=500,width=700,toolbar=0,location=0,directories=0,status=,menubar=0,scrollbars=,resizable=0')");
printwriter.println("if (navigator.appName=='Netscape') { ");
printwriter.println("popUpWin.focus()");
printwriter.println("}");
printwriter.println("}");
printwriter.println("function heloo() { " );
printwriter.println("javascript: doit('http://vikrant:8080/pop.html?"+URLEncoder.encode(pp)+"')");
printwriter.println("}");
printwriter.println("</script>");
printwriter.println("<tr>");
printwriter.println("<td width='100%'><font face=Arial><Font color=#283d6c> ");
printwriter.println(" There are currently 262 user(s) logged into this ");
printwriter.println(" �</font></font> ");
printwriter.println(" <p> <font face=Arial><Font color=283d6c>Please wait while the client finishes loading. this may take a minute or so");
printwriter.println(" </font></font><br><font face=Arial<font ");
printwriter.println(" color=#283d6c>depending on your computer and connection speeds. Please be patient...�</font></font>");
printwriter.println("Your automatic address could be ");
printwriter.println("
http://vikrant:8080/"+pp); printwriter.println("<body onload='heloo()'>");
printwriter.println("</body>");
printwriter.println("</html>");
}
}
}
public void init(ServletConfig servletconfig) throws ServletException
{
super.init(servletconfig);
}
}
Look at the code which is invoking pop.html. This is a javascript function which is opening up a pop up window and displaying applet in that window(applet tag is integrated in pop.html) and here is the code of pop.html :
<html>
<body leftmargin=0 topmargin=0 rightmargin=0>
<applet code="socs" width=700 height=500 vspace=0 hspace=0>
</applet>
</body>
</html>
Now, whenever the above servlet is invoked the browser displays a page consisting in a servlet but an applet is opened up in a separate pop up window (as expected through the javascript code in the servlet), now when I try to close the pop up window(i.e., the applet), it gets closed smoothly but browser gets hanged.
Hope now u get it, my dear friend. Do suggest a solution, if possible.
Regards,
[This message has been edited by Sam Cala (edited February 26, 2001).]
[This message has been edited by Sam Cala (edited February 26, 2001).]