close.html :
<html>
<body onLoad="window.close()">
</body>
Servlet :
Redirection redirection = new Redirection("/close.html");
this would work perfectly but then i need to add an html file to my webapp,
i don't want that ..
> is there a quick way to close the browser from a servlet ?
>
[quoted text clipped - 6 lines]
> How do i just close the browser, without any redirection ?.
> thanks
G - 29 Jul 2003 16:49 GMT
You don't need your extra file if you write "raw" html from your servlet:
public void doPost(HttpServletRequest req, HttpServletResponse resp) {
OutputStream out = req.getOutputStream();
out.write("<html>");
out.write("<body onLoad='window.close();'>");
out.write("</html>");
out.close();
}
(i've not tried the code above, but that is the idea)
Regards,
Guido
> close.html :
> <html>
[quoted text clipped - 20 lines]
>>How do i just close the browser, without any redirection ?.
>>thanks