Susan, there can be a number of things up.  Proxies and persistent 
connections can wreak havoc with the URLConnection class.  In your case 
the POST may not actually be happening.  These two articles helped me a lot:

http://www.javaworld.com/javaworld/jw-03-2001/jw-0323-traps_p.html
http://www.javaworld.com/javaworld/javatips/jw-javatip34.html

Also, a great new feature for those of us using URLConnection instead of 
sockets (which I still prefer) is that with 1.4 you can specify a read 
timeout (albeit using a property)!  Hope that helps, BenG.

Susan M. Orndorff wrote:

>Hi, All,
>    I have followed the code in Marty Hall's Core Web Programming to send POST data 
>directly to a servlet from an applet.  The code I used is:
>
>         URL url = new URL(protocol, host, port, uri);
>         URLConnection uc = url.openConnection();
>         uc.setUseCaches(false);
>         uc.setDoOutput(true);
>         ByteArrayOutputStream bs = new ByteArrayOutputStream(512);
>         PrintWriter pw = new PrintWriter(bs, true);
>         pw.print("ID=PennywiseTheClown&Role=BallAndPlateTwirler");
>         pw.flush();
>         String lengthString = String.valueOf(bs.size());
>         uc.setRequestProperty("Content-Length", lengthString);
>         uc.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
>         bs.writeTo(uc.getOutputStream());
>
>This works great in Internet Explorer.  The use of request.getParameter() in my 
>servlet gets the ID and Role passed with pw.print.  However, when I run the same code 
>in Netscape,  request.getParameter() in my servlet yields a null value.  Can anyone 
>tell me why this is happening, and/or how to fix it?  I am using IE 5.0 and Netscape 
>4.76, JRun 3.0 with IIS running on NT4.0.  Thanks in advance for any advice or help.
>
>Archives: http://www.mail-archive.com/[email protected]/
>Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=sts
>
>.
>

-- 
Ben Groeneveld 
Information Concepts, Inc., 115 N.W. Oregon, Suite 30, Bend, OR 97701
Mailto:[EMAIL PROTECTED], phone:541.388.3611, cell:208.520.6488



______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to