The IE3.0 Browser runs all Java http i/o operations without any problem.
In fact IE3.0 runs Java better than any
other browser out there... What is going on with IE4.0? Come on
Microsoft, you can do great things. I love your
your products. Why are you messing up Java?
Kevin Bohacz,
President of C:>Prompt
http://www.c-prompt-dev.com
JAVA CODE FRAGMENT:
/*************************************************************************
* Using a CGI Perl Script obtain the IP address of this client
*
* This simple bit of code works fine with all browsers and all servers
EXCEPT: IE4.0 and Unix
* web servers!
*
* (C) Copyright 1997 KJB Software Development Inc. (dba C Prompt). All
rights resevered.
*/
static String getClientIPAddr( String cgiScript )
{
String rawResults = new String();
String ipAddr = new String();
System.out.println( "CGIID=" + cgiScript );
try
{
URL destURL = new URL( cgiScript );
URLConnection urlConn = destURL.openConnection();
urlConn.setDoInput( true ); // we need to read a little
urlConn.setUseCaches( false ); // disable cache to insure
effective handshacking
DataInputStream insCGI = new DataInputStream(
urlConn.getInputStream() );
// Keep cheching to see if there is data to read back... we will
keep tring
// for 5 minutes.
for ( int waitCnt=0; insCGI.available() == 0 && waitCnt < (60*5);
++waitCnt )
{
try { Thread.sleep( 1000 ); }
catch ( InterruptedException eTimer ){}; // Sleep a bit
between reties
System.out.println( "CGI CLIENT ID: Please wait while reading
response: " + waitCnt + " seconds." );
}
while ( insCGI.available() > 0 )
rawResults += (char)insCGI.readByte();
insCGI.close();
}
catch ( Exception e )
{
System.out.println( "ERROR CGI INFO: (" + e.getMessage() + ")" );
return( "" );
}
//
// Code to parse out IP Address and set the value of ipAddr has been
removed for clarity.
//
if ( rawResults.length() > 0 )
System.out.println( "RAW CGI RETURN=" + rawResults );
return( ipAddr );
}
PERL SCRIPT THAT CGIPOST goes to:
!(C) Copyright 1997 KJB Software Development Inc. (dba C Prompt). All
rights resevered.
print "Content-Type: text/html\n\n";
print "<HTML>\n";
print "<HEAD>\n";
print "<TITLE>JSOF Client Info ver 1.01</TITLE>\n";
print "</HEAD>\n";
print "<BODY>\n";
print "<P>\n";
print "IP Address = $ENV{REMOTE_ADDR} [$ENV{REMOTE_HOST}]\n";
print "<BR>";
print "User Agent = $ENV{HTTP_USER_AGENT}\n";
print "</P>";
print "</BODY>\n";
print "</HTML>\n";
Kevin Bohacz wrote:
> My company is evaluating IE4.0 for compatibility with our Java hybrid
> Commerce system (JSOF). We have found
> that the browser does NOT run Java http i/o related operations properly
> from Unix Apache Servers, but does run
> properly from Windows NT Servers with IIS2.0, IIS3.0. The APACHE server
Heh.. funny, I was experiencing problems getting IIS 3.0 to send a message IE 4
could understand...
> is the #1 server running web sites
> around the world. The biggest of these http i/o problems is performing
> cgiposts (see attached Java and perl code
> fragment). This bug can now be added to the growing list of Java
> compatibility problems.
> URL destURL = new URL( cgiScript );
> URLConnection urlConn = destURL.openConnection();
>
> urlConn.setDoInput( true ); // we need to read a little
> urlConn.setUseCaches( false ); // disable cache to insure
> effective handshacking
> DataInputStream insCGI = new DataInputStream(
> urlConn.getInputStream() );
>
> // Keep cheching to see if there is data to read back... we will
> keep tring
> // for 5 minutes.
> for ( int waitCnt=0; insCGI.available() == 0 && waitCnt < (60*5);
> ++waitCnt )
This is a POST? Where's your getOutputStream? Where's your close? Your
flush? Where's the POSTed data?
Have you looked at the server logs? Debugged what it's actually getting?
--
Jason Marshall
Independent Java Contractor
jma...@ricochet.net.