You cannot calculate the codebase relative to the Portlet JSP
because this JSP is not accessed directly by the browser.

The codebase must be relative to the jetspeed servlet URI, which
is /jetspeed/portal/ by default, thus your codebase should
certainly be only "../applets", and this will work wherever your
portlet JSPs are located :)

--
Raphaël Luta - [EMAIL PROTECTED]
Jakarta Jetspeed - Enterprise Portal in Java
http://jakarta.apache.org/jetspeed/


> -----Message d'origine-----
> De : Gerry Reno [mailto:[EMAIL PROTECTED]
> Envoyé : dimanche 3 août 2003 22:33
> À : Jetspeed Users List
> Objet : JSP Portlet with Applet
>
>
> 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/My
> Applet.class
> with no proxy
> Connecting
> http://localhost:8080/../../../../applets/com/domain/applet/My
> Applet.class
> with cookie " "
> Connecting
> http://localhost:8080/../../../../applets/com/domain/applet/My
> Applet/class.class
> with no proxy
> Connecting
> http://localhost:8080/../../../../applets/com/domain/applet/My
Applet/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]

**********************************************
Vivendi Universal - HTTP://www.vivendiUniversal.com:
The information transmitted is intended only for the person or entity
to which it is addressed and may contain confidential and/or privileged
material of Vivendi Universal which is for the exclusive use of the
individual designated above as the recipient. Any review, retransmission,
dissemination or other use of, or taking of any action in reliance upon,
this information by persons or entities other than the intended recipient
is prohibited. If you received this in error, please contact immediately
the sender by returning e-mail and delete the material from any computer.
If you are not the specified recipient, you are hereby notified that all
disclosure, reproduction, distribution or action taken on the basis of this
message is prohibited.

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

Reply via email to