T
trpost
I am using javascript to call a hidden applet and am getting a
javascript error "java.lang.Exception: java.lang.NoClassDefFoundError:
org/apache/commons/httpclient/HttpClient" If I comment out the alert
statement then the applet loads fine, but when I make a javascript call
it looks like it needs to be aware of the classpath. I have all my .jar
files in the right place for the applet (C:\Program
Files\Java\jre1.5.0_06\classes) because if I move them out of the
directory then the applet fails with a NoClassDefFoundError. Any ideas
where javascript is looking for a classpath??
<html>
<head>
<title>Http status code demo</title>
</head>
<body>
<script type="text/javascript">
function getStatusCode(uri)
{
return document.applets['statusApplet'].getStatusCode(uri);
}
</script>
<applet name="statusApplet" CODEBASE
="http://localhost/php/client/applet/Tst/"
code="StatusCodeApplet.class" width="0" height="0"
archive="commons-httpclient-3.0.jar;commons-codec-1.3.jar;commons-logging.jar;commons-logging-api.jar"></applet>
<script type="text/javascript">
alert(getStatusCode("http://www.yahoo.com"));
</script>
</body>
</html>
javascript error "java.lang.Exception: java.lang.NoClassDefFoundError:
org/apache/commons/httpclient/HttpClient" If I comment out the alert
statement then the applet loads fine, but when I make a javascript call
it looks like it needs to be aware of the classpath. I have all my .jar
files in the right place for the applet (C:\Program
Files\Java\jre1.5.0_06\classes) because if I move them out of the
directory then the applet fails with a NoClassDefFoundError. Any ideas
where javascript is looking for a classpath??
<html>
<head>
<title>Http status code demo</title>
</head>
<body>
<script type="text/javascript">
function getStatusCode(uri)
{
return document.applets['statusApplet'].getStatusCode(uri);
}
</script>
<applet name="statusApplet" CODEBASE
="http://localhost/php/client/applet/Tst/"
code="StatusCodeApplet.class" width="0" height="0"
archive="commons-httpclient-3.0.jar;commons-codec-1.3.jar;commons-logging.jar;commons-logging-api.jar"></applet>
<script type="text/javascript">
alert(getStatusCode("http://www.yahoo.com"));
</script>
</body>
</html>