FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Applet problems...

 


wombatrpgs
Hello, I've been trying to get an applet for Eliza working on my website, however, I always seem to get a ClassNotFound exception. The script and class are exactly where they claim to be, and from the same server, and all other classes used by Eliza.class are in the same directory, but I'm still getting the error. This is what I'm using for the html page:

Code:
<html>
<head>
     <title>talk.html</title>
</head>
<body>

<center>
<applet code="http://www.wombatrpgs.frih.net/Eliza/Eliza.class" width="600" height="200">
<param name="script" value="http://www.wombatrpgs.frih.net/Eliza/script">
</applet>
</center>

</body>
</html>


Any ideas why that isn't working? Here's the page: http://www.wombatrpgs.frih.net/Eliza/talk.html
qscomputing
It's something to do with the way Java resolves the URI for the class file - it doesn't treat it just as a URI, but as (IIRC) a Java package specification. So the best thing to do it to use a relative URI, with the class file in the same directory - ie:
Code:
<applet code="Eliza.class" width="600" height="200">

The parameter obviously depends on how you've programmed your applet to recognize that parameter.

HTH.
jabapyth
i believe you put the relative place in "codebase" and the actuall class name in "code"

Code:
<applet codebase="http://www.wombatrpgs.frih.net/Eliza/" code="Eliza.class" width="600" height="200">
<param name="script" value="http://www.wombatrpgs.frih.net/Eliza/script">
</applet>
wombatrpgs
qscomputing wrote:
It's something to do with the way Java resolves the URI for the class file - it doesn't treat it just as a URI, but as (IIRC) a Java package specification. So the best thing to do it to use a relative URI, with the class file in the same directory - ie:
Code:
<applet code="Eliza.class" width="600" height="200">

The parameter obviously depends on how you've programmed your applet to recognize that parameter.

HTH.


I've been screwing around with that pathname all day; unfortunately nothing I can think up works...

jabapyth wrote:
i believe you put the relative place in "codebase" and the actuall class name in "code"


Alright, did that, refreshed, still nothing...
However, looking at Sun's site I can't view their applets either... Same NullPointerException... I'm downloading latest version. But I'd be grateful if someone else could check the page and see if the applet loads; not sure if my old computer can even handle it...
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.