Chunked Transfer-Encoding problem 2005-02-01 - By Sasikumar Subramanian
Back Hi All,
I write one servlet program with Chunked Transfer Encoding. when i execute this servlet in IE, my browser was hanged. But i got the following exception, if i execute by httpunit.
java.io.IOException: Bogus chunk size
I donno why this exception occured. can anybody solve my problem?
Thanks and Regards, Sasikumar
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ import javax.servlet.ServletException; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException;
public class SampleServlet1 extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request, response); }
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); response.setHeader("Transfer-Encoding", "chunked"); ServletOutputStream out = response.getOutputStream(); out.println("<html><head><title>"); out.println("Chunked Transfer Encoding Test #1"); out.println("</title></head><body>"); out.println("<h1 align=center>Chunked Transfer Encoding #1</h1>"); for( int i=0; i<50; i++ ) { out.println( "<p><h3>Chunked Transfer Encoding was enabled for this servler response</h3></p>"); }
out.println("</body></html>"); } } -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
__ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ __ To unsubscribe, send email to listserv@(protected) and include in the body of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
|
|