|
|
|
|
Embeddeding applets in HTML5
Posted:
Sep 16, 2008 8:36 PM
|
|
|
I found the current draft of HTML5 obsoletes the applet element in favor of the object or embed element for consistency. The applet element was actually deprecated in HTML 4.0 but it has been the only portable way to embed applets for long.
HTML5 suggests the following HTML construct to embed an applet: (http://www.w3.org/html/wg/html5/#object)
<object type="application/x-java-applet"> <param name="..." value="..."> ... </object>
This just works in Firefox but does not in MSIE at all. So I tried to make MSIE work as Firefox by setting some registry keys according to the information from MSDN. (http://msdn.microsoft.com/en-us/library/aa751976(VS.85).aspx)
I set the following registry key so that the Java Plug-in ActiveX component is used for the application/x-java-applet media type:
HKEY_CLASSES_ROOT\MIME\Database\Content Type\application/x-java-applet CLSID="{8AD9C840-044E-11D1-B3E9-00805F499D93}"
With the registry setting, MSIE instantiated the Java Plug-in for the HTML construct above but strangely it reported exceptions that it could not read any JNLP file (I used the jnlp_href parameter). It may be because the Java Plug-in has not been programmed for such instantiations. I could not figure out how to fix the problem.
I hope the future version of Java Plug-in will support embedding by MIME media type in MSIE so that we can use the single object element to embed an applet for all browsers.
|
|
|
|
|
|
|
Re: Embeddeding applets in HTML5
Posted:
Sep 21, 2008 1:57 PM
in response to: kazssym
|
|
|
Thanks for pointing this out and trying to work around the problem. I hadn't been aware that the applet tag had actually been obsoleted in HTML 5. We need to fix the IE port of the Java Plug-In to support the specification of the application/x-java-applet MIME type in the object tag. Currently there are assumptions that the IE-specific CLSID mechanism is always being used. I've filed 6750726 to track this issue and marked it with the highest priority. FWIW, I've also filed a bug with the W3C asking them to please not break the applet tag, but instead to leave it deprecated: http://www.w3.org/Bugs/Public/show_bug.cgi?id=6102 .
|
|
|
|
|
|
|
|
Re: Embeddeding applets in HTML5
Posted:
Sep 27, 2008 3:36 AM
in response to: kbr
|
|
|
IMHO, it is a good move to drop the Java-only applet element from the HTML standard. The object element standardized in HTML 4.0 is fairly generic enough to support not only Java applets but also other embeddable objects in a consistent manner. If Java still requires a dedicated element to embed applets in a HTML document, it must be Sun's negligence for the past ten years.
|
|
|
|
|
|
|
|
Re: Embeddeding applets in HTML5
Posted:
Sep 27, 2008 9:28 AM
in response to: kazssym
|
|
|
> IMHO, it is a good move to drop the Java-only > applet element from the HTML standard. The object > element standardized in HTML 4.0 is fairly generic > enough to support not only Java applets but also > other embeddable objects in a consistent manner. If > Java still requires a dedicated element to embed > applets in a HTML document, it must be Sun's > negligence for the past ten years.
Can you justify your humble opinion? Can you justify all the work to rewrite all the thousands of HTML pages that use the applet tag just to satisfy your humble opinion?
The applet tag may be archaic but it's deep in the fabric of the web and satisfying your humble opinion will cause thousands of people grief.
Changing to an object or embed tag can happen slowly and naturally over time. It can't happen overnight to satisfy an urge for tidiness.
And from one of SUN's own docs which pretty much sums up the reason for the continued existence of the the applet tag:
http://java.sun.com/javase/6/docs/technotes/guides/plugin/developer_guide/using_tags.html#applet
Note: The HTML specification states that the applet tag is deprecated, and that you should use the object tag instead. However, the specification is vague about how browsers should implement the object tag to support Java applets, and browser support is currently inconsistent. Sun therefore recommends that you continue to use the applet tag as a consistent way to deploy Java applets across browsers on all platforms.
|
|
|
|
|
|
|
|
Re: Embeddeding applets in HTML5
Posted:
Oct 5, 2008 3:45 AM
in response to: demonduck
|
|
|
I do not insist that all the current HTML documents must be converted but any new HTML documents that the authors want them to be compliant to the new HTML standard should be written using the object tag instead of applet. I hope most browsers will keep their applet tag support but it does not mean it is necessary to define it in any new HTML standard.
|
|
|
|
|
|
|
|
Re: Embeddeding applets in HTML5
Posted:
Oct 5, 2008 9:54 AM
in response to: kazssym
|
|
|
> I do not insist that all the current HTML documents > must be converted but any new HTML documents > that the authors want them to be compliant to the new > HTML standard should be written using the object tag > instead of applet. I hope most browsers will keep > their applet tag support but it does not mean it is > necessary to define it in any new HTML standard.
Why? What do you find so disagreeable with the applet tag? Is this a religious thing? Should we also have to stop calling applets -- applets?
Maybe we should call applets objectletts --- would that appease you?
|
|
|
|
|
|
|
|
Re: Embeddeding applets in HTML5
Posted:
Oct 5, 2008 12:01 PM
in response to: demonduck
|
|
|
> Maybe we should call applets objectletts from the perspective of HTML 5 they are probably called embedded objects.
The applet tag is already deprecated for a long time and the object tag is a simple move to generalize things and prevent richlet, flashlet, stragelet, etc-let tags...
Browsers have several fallback renerers anyway, so don't panic. Sun should only ensure that the plugin works with object tags and everything is fine.
|
|
|
|
|
|
|
|
Re: Embeddeding applets in HTML5
Posted:
Oct 5, 2008 12:46 PM
in response to: mbien
|
|
|
I can live with this idea if the OBJECT tag works exactly the same in all browsers and that the OBJECT tag will support all the necessary param's that are used today like boxbgcolor and image and java_arguments and that it's easier to use than the applet tag.
If the OBJECT tag is absolutely consistent in every browser and it's easier to use -- that's a good idea and then the OBJECT tag can naturally and organically replace the applet tag. That's fine.
What I don't like is imperious pronouncements that we should get rid of the applet tag. Make a better alternative available and universal and then the transition to the new way of invoking an applet will naturally and organically replaces the applet tag simply because it is better. Don't just trash the applet tag because it doesn't fit neatly into a few peoples idea of tidiness.
Let the applet tag die a natural death so that people who have hundreds of HTML pages with applet tags don't suddenly have a massive editing job.
Remember it is SUN that recommends the use of the applet tag BECAUSE the OBJECT tag is not consistently implemented in all browsers. That will have to be fixed first don't you think?
|
|
|
|
|
|
|
|
Re: Embeddeding applets in HTML5
Posted:
Oct 5, 2008 2:06 PM
in response to: demonduck
|
|
|
> Remember it is SUN that recommends the use of the > applet tag BECAUSE the > OBJECT tag is not consistently implemented in all > browsers. That will have to be > fixed first don't you think? agreed
|
|
|
|
|