on 7/18/2000 7:51 PM, "Samuel SHUM" <[EMAIL PROTECTED]> wrote:
> java.lang.NullPointerException
> at java.net.URLConnection.stripOffParameters(URLConnection.java:1016)
I found that while doing Noodle (another project I will be announcing
shortly if you all care about it), that URLConnection was EXTREMELY buggy.
If the remote server does not return a Content-Type: HTTP header, I would
get exceptions like this. I imagine that it might also happen with other
HTTP headers it is expecting.
You can work around this bug in URLConnection by try/catching the NPE and
calling URLConnection.getInputStream() to grab the content.
Whomever wrote java.net.* should be fired. The design and implementation of
most of the classes in that package just plain suck. There are numerous open
bugs in the JDC about it.
I eventually switched to using HTTPClient because URLConnection didn't
handle multple Set-Cookie headers. It is LGPL and fairly well implemented
(although it has some implementation details I find annoying as well).
<http://www.innovation.ch/java/HTTPClient/>
-jon
--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/main/mail.html>
Problems?: [EMAIL PROTECTED]