Hi all,

I am trying to use servlet - applets to get a chatsession(ref - OReilly
book on Servlets) .
 The problem arises when I try to run the applet in Netscape. For some
reason, the post command doesnot seem to work in Netscape. I am rather
stumped here.
ANY IDEAS would be appreciated!

The code snippet from the applet that is posting the message is -

        URLConnection con = servlet.openConnection();
        con.setDoInput(true);
        con.setDoOutput(true);

        con.setUseCaches(false);

        con.setRequestProperty("Content-Type","application/x-www-form-urlencoded");

        DataOutputStream out = new
        DataOutputStream(con.getOutputStream());

        out.writeBytes(argString);
        out.flush();
        out.close();


The argString is encoded using the method-

public String toEncodedString(Properties args)
{
        StringBuffer buf = new StringBuffer();
        Enumeration names = args.propertyNames();
        while(names.hasMoreElements())
        {
                String name = (String) names.nextElement();
                String value = args.getProperty(name);
                buf.append(URLEncoder.encode(name) + "="
+URLEncoder.encode(value));
                if(names.hasMoreElements()) buf.append("&");
        }
        return buf.toString();
}



Thanks,
Samian

___________________________________________________________________________
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