According to the README that tags along with the jswdk1.0.1:

Bugs Fixed in This Release

This version of the JSWDK is a bug fix release, correcting the following
bugs:

  1.Earlier versions had a bug in handling data sent from the client to
     the server by an HTTP POST method. This bug caused the error
     message Connection reset by peer to appear in the user's Web
     browser. This bug has been fixed. You can now use the HTTP POST
     method in a JSP file to send data from an HTML form to the Web
     server.

However the following code:

    public void doPost(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException
    {
        HTMLDocument doc = new HTMLDocument("Thanks Last Document");
        HttpSession session = req.getSession(true);
        setContentType("text/html");
        ServletOutputStream out= res.getOutputStream();
        doc.addObject(new HTMLHeading("This is the Thanks Last Output",
                                                 HTMLHeading.H2));
        doc.addObject(new HTMLLineBreak());
        doc.addObject(new HTMLText("The first number was:"));
        Integer num = (Integer) session.getValue("Puss");
        doc.addObject(new HTMLText(num.toString()));
        doc.addObject(new HTMLText("The second number was:"));
        doc.addObject(new HTMLText(req.getParameter("Field2")));
        out.println(doc.toHTML());
        out.close();
    }

will cause Netscape 4.61 to again vomit the "Network Error: Reset by Peer"
message unless I remove the out.close(); instruction.  this does not happen
with a out.close(); instruction in a doGet(req, res) method. (Note that in the
above code the HTMLxxx methods are just a parsing library that I use to write
HTML, the result is no different if I hand code the HTML.)

Is this still a bug?  What will be the results in with a high volume servlet of
NOT closing the OutputStream?  Should I not close the stream in a doGet(req,
res) method?

All comments welcome
john

----------------------------------
E-Mail: John N. Alegre <[EMAIL PROTECTED]>
Date: 30-Nov-99
Time: 19:14:56

This message was sent by XFMail
----------------------------------

___________________________________________________________________________
To unsubscribe, send email to [EMAIL 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

Reply via email to