Hi,

> -----Original Message-----
> From: Christopher Schultz [mailto:ch...@christopherschultz.net]
> Sent: Tuesday, January 29, 2013 6:38 PM
> To: Tomcat Users List
> Subject: Re: html page can not present an java Applet embedded in the
> page
> 
> Also, Oracle says this only works with Microsoft Internet Explorer. An
> online HOW-TO[2] (a bit dated) says that you can still use <object> in
> other browsers, but the syntax is a little different:
> 
> <object classid="java:fully/qualified/class/name.class"
>               type="application/x-java-applet">
>   <param name="code" value="fully/qualified/class/name.class" />
> [...]
> </object>
> 
> I'm not sure why you have to specify the class name twice in there.
> That page also shows you how to embed Java applets in such a way that
> they will work in both MSIE and everywhere else. Oracle has similar
> documentation in their page I referenced, though using a different
> technique. You'll have to test in your target environment to see what
> actually works for you.


I don't know why Oracle says that you need different syntaxes for IE and other 
browsers (that probably applied to old versions of the HTML spec and browsers), 
since e.g. the following syntax works for me with IE, Firefox and Chrome (which 
is also given as a example in the current HTML5 spec [1]):

  <object type="application/x-java-applet">
    <param name="code" value="mypackage.MyClass" />
    <param name="archive" value="MyJarFile.jar" />
    <param name="java_arguments" value="-Dsun.java2d.d3d=false" />

    Your don't have the Java plugin installed...
  </object>


However, I would recommend the <embed> element because it allows Browsers to 
display a specific error message when the Java plugin is not installed:

  <embed type="application/x-java-applet" code="mypackage.MyClass" 
archive="MyJarFile.jar" java_arguments="-Dsun.java2d.d3d=false" />


Regards,
Konstantin Preißer


[1] http://www.w3.org/TR/html51/embedded-content-0.html#the-object-element


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to