Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

text/plain content handler in Mac Netscape 3.0?

0 views
Skip to first unread message

Bernie Bernstein

unread,
Aug 28, 1996, 3:00:00 AM8/28/96
to

Greetings,

I've been quietly picking up some great help here at c.l.j.p, but I have
come across something that I have not yet seen addressed here.

I have a Java chat applet that I'm working on:

http://chat.talkcity.com/java/

And I have found a problem with the Mac Netscape 3.0 implementation with
regard to the text/plain content handler.

When my code asks for some text from a file, it fails with a
"java.lang.ClassNotFoundException: sun/net/www/content/text/plain" error.

Here is the code: (incidentally, it used to just use the url.getcontent(),
but it had the same results)

URL dURL;
...
try{
dURL = new URL( this.getCodeBase(), "textfile.txt" );
URLConnection conn = tickerDataURL.openConnection();
String data = (String)conn.getContent();
} catch (Exception e){
...
}

The full Netscape error stack is:

java.lang.ClassNotFoundException: sun/net/www/content/text/plain
at java.net.URLConnection.getContentHandler(URLConnection.java:393)
at java.net.URLConnection.getContent(URLConnection.java:186)
at ChatLauncher.showTickerMsg(ChatLauncher.java:189)
at ChatLauncher.hitStartButton(ChatLauncher.java:145)
at ChatLauncher.action(ChatLauncher.java:224)
at java.awt.Component.handleEvent(Component.java:900)
at java.awt.Component.postEvent(Component.java:838)
at java.awt.Component.postEvent(Component.java:845)
at sun.awt.macos.MTextFieldPeer.action(MTextFieldPeer.java:61)
at
sun.awt.macos.InterfaceThread.dispatchInterfaceEvent(InterfaceThread.java:189)
at java.lang.Thread.run(Thread.java:296)


This seems kinda strange, and it doesn't seem to happen on any platform
but the Mac. In no place in the code is the content factory changed or set
in any way, and it even recognizes that the file is text/plain as
evidenced by the exception.

The file initially just had text in it, and then I added a MIME header
which specified text/plain, and got the same results.

--------- textfile.txt -----------
Content-type: text/plain

Rest of the file data...
---------

Any ideas or suggestions for working around this problem? It seems that
Mac Netscape 3.0 just doesn't have a plain text handler. Is that true or
do I just have a corrupt Netscape on the two Mac's on which I installed
it?

If you reply to the group, please also send me email since I may lose it here.

Thank much,

--
o, ,, , | Bernie Bernstein |
L>O/ `,/ ` ,| Liveworld Productions |
O./ ' / . `, / | voice: 408-777-0395 |
,/ / , ' | email: ber...@liveworld.com |

0 new messages