[3490] in java-interest
URL.getContent() - html class?
daemon@ATHENA.MIT.EDU (nataraj@cat.syr.edu)
Tue Nov 14 16:52:38 1995
From: nataraj@cat.syr.edu
To: java-interest@java.sun.com
Date: Mon, 13 Nov 95 17:21:08 EST
Hi,
I am trying to understand/use the getContent() method in the URL class.
The code snippet is as follows:
URL myURL = new URL("http://www.cat.syr.edu/~nataraj");
URLConnection myConn = myURL.openConnection();
:
:
Object obj = myURL.getContent();
But when this is compiled and run, it executes this "getContent()"
statement and gives the following error:
java.lang.ClassNotFoundException: sun/net/www/content/text/html
at java.net.URLConnection.getContentHandler(URLConnection.java)
at java.net.URLConnection.getContent(URLConnection.java)
at java.net.URL.getContent(URL.java)
at Urlfun.main(Urlfun.java:30)
The contents is html ...but the classes under the sun/net/www/content/text are
plain and Generic and I couldnt find the html.class in that class directory.
If there doesnt exist a html.class, why is it being searched for?
What should I do? ANy pointers/ideas are appreciated.
thanks,
- -Nataraj
(nataraj@cat.syr.edu)
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com