Guess what it was, then? It was the Java Plugin Properties Dialog under the Windows
Control Panel
I did ______NOT_______ tick the "Use browser settings"
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
========================================================================
THE SOLUTION: Try switching on "Use Browser Settings" under the `Proxies' tab
especially when deployed on a Intranet and behind a firewall
========================================================================
To cut a long story short. HTTP Tunnelling is working fine. Except my JTree doesn't
seem to be filling
with nodes. But leasts the communication is active.
I actually experimented with a new class to try grok this out. In the end it wasn't
necassary:
/**
*
* <code>PluginHttpMessage</code>
*
* <p> Desperate class to try to get plugin to run with AdminApplet </p>
*
* @author Peter A. Pilgrim, Tue Sep 26 12:09:37 BST 2000
* @version $Id$
*/
public class PluginHttpMessage
{
protected URL servlet = null;
protected String args = null;
/**
* Constructs a new HttpMessage that can be used to communicate with the
* servlet at the specified URL.
*
* @param servlet the server resource (typically a servlet) with which
* to communicate
*/
public PluginHttpMessage( URL servlet ) {
this.servlet = servlet;
}
/**
* Performs a POST request to the servlet, uploading a serialized object.
* The type of the uploaded object is sent as
* content type (<tt>application/<i>x-java-serialized-object</i></tt>).
*
* @param obj the serializable object to upload
* @return an InputStream to read the response
* @exception IOException if an I/O error occurs
*/
public InputStream sendPostMessage(Serializable obj)
throws IOException
{
System.out.println( "PHM.sendPostMessage()" );
URLConnection con = servlet.openConnection();
// Turn off caching
con.setUseCaches(false);
con.setRequestProperty("CONTENT-TYPE", "application/x-java-serialized-object");
con.setDoInput(true);
con.setDoOutput(true);
// Set the request to "POST"
if ( con instanceof HttpURLConnection ) {
HttpURLConnection htcon = (HttpURLConnection)con;
htcon.setRequestMethod("POST");
}
ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
ObjectOutputStream out = new ObjectOutputStream(baos);
// Write the serialized object as post data
out.writeObject(obj);
out.flush();
// Set the content length
con.setRequestProperty("CONTENT-LENGTH", Integer.toString( baos.size() ) );
System.out.println( "url:`"+servlet+"', content-length:"+baos.size() );
OutputStream sout = con.getOutputStream();
baos.writeTo( sout );
sout.flush();
sout.close();
return con.getInputStream();
}
}
Here is the plug.trace below. Notice that I switched off the proxy apparently.
That means the examples at http://java.sun.com/products/plugins1.3/examples/*
wont work anymore, because I have effectively disabled any comms thru the firewall,
and since this meant to be an intranet application, who cares ...
PHM.sendPostMessage()
url:`http://poppy.dev.lon.deuba.com:9090/pilgpe/servlet/com.db.docserv.servlet.AdminServlet',
content-length:132
Opening
http://poppy.dev.lon.deuba.com:9090/pilgpe/servlet/com.db.docserv.servlet.AdminServlet
no proxy
Opening
http://poppy.dev.lon.deuba.com:9090/~pilgpe/docserv/com/db/docserv/ViewSet.class no
proxy
CacheHandler file name: C:\WINNT\Profiles\pilgpe\Temporary Internet
Files\Content.IE5\P5SIK4KD\ViewSet[1].class
Server returned default view:OTC Home - IT
rootView:{ id:1, descrip:`OTC Home - IT', rootIndexItem:101 }
updateViewSetList_Server()
url:`http://poppy.dev.lon.deuba.com:9090/pilgpe/servlet/com.db.docserv.servlet.AdminServlet'
PHM.sendPostMessage()
url:`http://poppy.dev.lon.deuba.com:9090/pilgpe/servlet/com.db.docserv.servlet.AdminServlet',
content-length:132
Opening
http://poppy.dev.lon.deuba.com:9090/pilgpe/servlet/com.db.docserv.servlet.AdminServlet
no proxy
Server returned Vector list:[OTC Home - IT]
applet initialised
LET IT BE ARCHIVED FOREVER MORE ...
--
Peter Pilgrim
Welcome to the "Me Too" generation.
---------------------------------------- Message History
----------------------------------------
From: [EMAIL PROTECTED] on 26/09/2000 14:20
Please respond to [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
cc:
Subject: Re: HTTP Tunnelling + Applet + Java Plug1.3 + Servlets 2.0
Hi Peter,
The following is my testing with HttpURLConnection and
URLConnection :
0
In pure-IE5.0 and pure-NN4.7:
a I can use the following code:
...
con=(URLConnection)url.openConnection();
...
b I can NOT use the following code:
...
con=(HttpURLConnection)url.openConnection();
con.setRequestMethod("POST"); //or GET
...
Otherwise I will get a Exception like "ClassCastException" :-) :-)
--<SNIP>--
--
This e-mail may contain confidential and/or privileged information. If you are not the
intended recipient (or have received this e-mail in error) please notify the sender
immediately and destroy this e-mail. Any unauthorised copying, disclosure or
distribution of the material in this e-mail is strictly forbidden.
___________________________________________________________________________
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