u must set the content length of the servlet response when writing/streaming back to
the browser
example code from my stuff....were generating a report, converting it to byte[] and
streaming back to client..
public void doPost(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
ServletOutputStream toClient = null;
RMDocument report = template.generateReport(mbIncTransList);
byte reportBytes[] =null;
res.setContentType("application/pdf"); // where response is the
HttpServletResponse
reportBytes = report.pdfBytes();
Integer sizeOfReport = new Integer(reportBytes.length);
res.setHeader("Content-Length", sizeOfReport.toString());
res.setContentLength(reportBytes.length);
toClient = res.getOutputStream();
toClient.write(reportBytes);
toClient.flush();
-----Original Message-----
From: Viswanathan, Cheenuvasan (MED, TCS)
[mailto:[EMAIL PROTECTED]
Sent: 23 March 2004 03:31 PM
To: Struts Users Mailing List
Subject: Connection failure
Hi,
Can anyone give me the solution or leads? This problem happens sometimes not
regularly.
Mar 23, 2004 6:58:13 PM GMT+05:30> <Error> <HTTP> <BEA-101083> <Connection
failure.
ava.net.ProtocolException: Didn't meet stated Content-Length, wrote: '2'
bytes instead of stated: '1214' by
at
weblogic.servlet.internal.ServletOutputStreamImpl.ensureContentLength()V(Ser
vletOutputStreamImpl.
at
weblogic.servlet.internal.ServletResponseImpl.ensureContentLength()V(Servlet
ResponseImpl.java:117
at
weblogic.servlet.internal.ServletResponseImpl.send()V(ServletResponseImpl.ja
va:1188)
at
weblogic.servlet.internal.ServletRequestImpl.execute(Lweblogic.kernel.Execut
eThread;)V(ServletReq
:2590)
at
weblogic.kernel.ExecuteThread.execute(Lweblogic.kernel.ExecuteRequest;)V(Exe
cuteThread.java:197)
at weblogic.kernel.ExecuteThread.run()V(ExecuteThread.java:170)
at java.lang.Thread.startThreadFromVM(Ljava.lang.Thread;)V(Unknown
Source)
Mar 23, 2004 6:58:13 PM GMT+05:30> <Error> <HTTP> <BEA-101104> <Servlet
execution in servlet context "Servl
34182276,name=lba,context-path=/lba)" failed, java.net.ProtocolException:
Didn't meet stated Content-Length
bytes instead of stated: '1214' bytes..
ava.net.ProtocolException: Didn't meet stated Content-Length, wrote: '2'
bytes instead of stated: '1214' by
at
weblogic.servlet.internal.ServletOutputStreamImpl.ensureContentLength()V(Ser
vletOutputStreamImpl.
at
weblogic.servlet.internal.ServletResponseImpl.ensureContentLength()V(Servlet
ResponseImpl.java:117
at
weblogic.servlet.internal.ServletResponseImpl.send()V(ServletResponseImpl.ja
va:1188)
at
weblogic.servlet.internal.ServletRequestImpl.execute(Lweblogic.kernel.Execut
eThread;)V(ServletReq
:2590)
at
weblogic.kernel.ExecuteThread.execute(Lweblogic.kernel.ExecuteRequest;)V(Exe
cuteThread.java:197)
at weblogic.kernel.ExecuteThread.run()V(ExecuteThread.java:170)
at java.lang.Thread.startThreadFromVM(Ljava.lang.Thread;)V(Unknown
Source)
thanks.
Cheenu.
NOTICE:
This message contains privileged and confidential information intended
only for the person or entity to which it is addressed.
Any review, retransmission, dissemination, copy or other use of, or
taking of any action in reliance upon this information by persons or
entities other than the intended recipient, is prohibited.
If you received this message in error, please notify the sender
immediately by e-mail, facsimile or telephone and thereafter delete the
material from any computer.
Metropolitan Holdings Limited, its subsidiaries or associates do not
accept liability for any personal views expressed in this message.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]