Env:
RH8.0
J2SE 1.4.2
Tomcat 4.1.24
Jetspeed 1.4b4

  I am seeing strange behavior when trying to use an applet in a JSP
Portlet.  The entries in my jsp file within the applet tag are:

<applet 
      code="com.domain.applet.MyApplet.class"
  codebase="../../../../../applets" 
   archive="domain-applets-myapplet.jar, 
           ../lib/jjj.jar,
            " 
...
</applet>

  The codebase is set this way due to the jsp file being in the
WEB-INF/templates/jsp/portlets/html/ directory.  The codebase for an
applet is calculated relative to the html/jsp file containing the
applet tag.


  Using Mozilla from Linux:
  The Java Console shows the following output:
Loading applet ...
Initializing applet ...
Starting applet ...
Connecting
http://localhost:8080/../../../../applets/domain-applets-myapplet.jar
with no proxy
Connecting
http://localhost:8080/../../../../applets/domain-applets-myapplet.jar
with cookie " "
Connecting http://localhost:8080/../../../../applets/../lib/jjj.jar
with no proxy
Connecting http://localhost:8080/../../../../applets/../lib/jjj.jar
with cookie " "
Connecting
http://localhost:8080/../../../../applets/com/domain/applet/MyApplet.class
with no proxy
Connecting
http://localhost:8080/../../../../applets/com/domain/applet/MyApplet.class
with cookie " "
Connecting
http://localhost:8080/../../../../applets/com/domain/applet/MyApplet/class.class
with no proxy
Connecting
http://localhost:8080/../../../../applets/com/domain/applet/MyApplet/class.class
with cookie " "
load: class com.domain.applet.MyApplet.class not found.
java.lang.ClassNotFoundException: com.domain.applet.MyApplet.class
        at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:154)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
        at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:115)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
        at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:558)
        at sun.applet.AppletPanel.createApplet(AppletPanel.java:617)
        at sun.plugin.AppletViewer.createApplet(AppletViewer.java:1848)
        at sun.applet.AppletPanel.runLoader(AppletPanel.java:546)
        at sun.applet.AppletPanel.run(AppletPanel.java:298)
        at java.lang.Thread.run(Thread.java:534)
Caused by: java.io.IOException: open HTTP connection failed.
        at sun.applet.AppletClassLoader.getBytes(AppletClassLoader.java:257)
        at sun.applet.AppletClassLoader.access$100(AppletClassLoader.java:43)
        at sun.applet.AppletClassLoader$1.run(AppletClassLoader.java:144)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:141)
        ... 9 more
Exception: java.lang.ClassNotFoundException:
com.domain.applet.MyApplet.class


  Using IE6 under Windows:
  The Java Console shows the following output:
java.io.FileNotFoundException:
http://localhost:8080/applets/domain-applets-myapplet.jar 


  From the Java Console output it appears as though the portlet is
running the jsp file from http://localhost:8080 for Mozilla (and is
cutting off one of the "../" in the codebase) and from
http://localhost:8080 for IE6 (and is ignoring the ../../../../../
leading path altogether) rather than from the template directory where
it is stored.  This is not good.  It means that for any applet we
cannot calculate codebase paths relative to the jsp file which is what
you are supposed to do when using an applet.

  BTW, my applet works correctly in an iframe portlet in both browsers.

  Has anyone had any success displaying an applet from a JSP Portlet?

thx,
Gerry Reno



__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to