Article View: borland.public.jbuilder.java.language
Article #17008Re: HttpURLConnections broken? IE broken?
From: ted19
Date: Sat, 26 Dec 1998 00:00
Date: Sat, 26 Dec 1998 00:00
40 lines
2318 bytes
2318 bytes
Awww heck...I hate it when I do that. I answered my own question in public.
For the curious, it's a security issue with a published workaround.
Here's an article on the subject:
http://www.javaworld.com/javaworld/javatips/jw-javatip34.html/
Thanks,
Ted
In article <763b99$u11$1@nnrp1.dejanews.com>,
ted19@hotmail.com wrote:
> This is my understanding of how to POST data on an http connection from Java:
>
> URL url = new URL("http://mario:8001/servlets/HighScoresServlet.class");
> URLConnection urlc = url.openConnection();
> HttpURLConnection http = (HttpURLConnection) urlc;
> http.setDoOutput(true);
> http.setMethod("POST");
> OutputStream out = http.getOutputStream();
> ...
>
> In IE, the openConnection() call returns a
> com.ms.net.wininet.http.HttpURLConnection
> which is ***not a subclass of java.net.HttpURLConnection***!!!
> (Thus causing a ClassCastException)
>
> How the heck am I supposed to POST data without access to the
> setMethod("POST") method in java.net.HttpURLConnection? Is this an attempt to
> get me to write nonportable code? I want to move serialized objects to a
> servlet, and POST is the only way. The default GET method is not what I want.
>
> Thanks,
> Ted
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Technical Details
Message-ID:
<763dha$vom$1@nnrp1.dejanews.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<763b99$u11$1@nnrp1.dejanews.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 146a3d,9ef198bdac1f7c22 X-Google-Attributes: gid146a3d,public X-Google-Thread: f74b3,9ef198bdac1f7c22 X-Google-Attributes: gidf74b3,public From: ted19@hotmail.com Subject: Re: HttpURLConnections broken? IE broken? Date: 1998/12/26 Message-ID: <763dha$vom$1@nnrp1.dejanews.com> X-Deja-AN: 425966091 References: <763b99$u11$1@nnrp1.dejanews.com> X-Http-Proxy: 1.1 x10.dejanews.com:80 (Squid/1.1.22) for client 153.37.12.146 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Sat Dec 26 19:30:49 1998 GMT Newsgroups: borland.public.jbuilder.java.language,borland.public.jbuilder.java.applet-issues X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows 98)