Re: Problem with multipart/x-mixed replace
Carl Kugler (kugler@us.ibm.com)
Fri, 6 Apr 2001 14:51:44 -0600
I think you will find that IE does not support "multipart/x-mixed-repl=
ace"
despite its claim of "User-Agent:=A0 Mozilla/4.0 (compatible..."
You might try asking over on www-talk (see
http://lists.w3.org/Archives/Public/www-talk/).
-Carl
=
=20
"Seema P Kumar" =
=20
<2kseema@sun20.datam To: <http-wg@cuckoo.=
hpl.hp.com> =20
atics.com> cc: =
=20
Subject: Problem wit=
h multipart/x-mixed replace =20
03/30/2001 04:41 AM =
=20
=
=20
=
=20
Hi all !
=A0Could anybody tell me about the "multipart/x-mixed-replace" content=
type
?
=A0I try to use thie content type for my HTTPServletResponse object in=
my
Java servlet, to keep
=A0outputting messages to
=A0the browser, but however, the browser does not interpret the header=
s
=A0properly and all the tags are visible as
=A0part of the browser content (I use Internet Explorer 5.0).
The following is the Java code :
public class RefreshingServlet extends HttpServlet{
=A0public void init(ServletConfig config) throws ServletException{
=A0=A0super.init(config);
=A0}
public void service(HttpServletRequest req, HttpServletResponse res)
=A0=A0=A0 throws ServletException, IOException
{
=A0=A0=A0 res.setContentType("multipart/x-mixed-replace;boundary=3D\"b=
oundary\"");
=A0=A0PrintWriter out=3Dres.getWriter();
=A0=A0=A0 // Here is the first part
=A0=A0=A0 out.print("\n\r--boundary\n\r");
=A0=A0=A0 out.print("Content-Type: text/html\n\r");
=A0=A0=A0 out.println("<H1>Waiting...</H1>");
=A0=A0=A0 out.flush();
=A0=A0=A0 // Here is the long work (here, a sleep)
=A0=A0=A0 try
=A0=A0=A0=A0=A0=A0=A0=A0 Thread.sleep(3000);
=A0=A0=A0 }
=A0=A0=A0 catch (Exception e) {
=A0=A0=A0=A0=A0=A0=A0=A0 // ignore
=A0=A0=A0 }
=A0=A0=A0 // Here is the second part
=A0=A0=A0 out.print("\n\r--boundary\n\r");
=A0=A0=A0 out.print("Content-Type: text/html\n\r");
=A0=A0=A0 out.println("<H1>Done</H1>");
=A0=A0=A0 out.print("\n\r--boundary--\n\r");
=A0=A0=A0 out.flush();
}
}
Any loopholes for this ?
Regards,
Seema Kumar
Datamatics Technologies Ltd.,
(Tel: 8290829 (Ext:619))
=